Closed matthiasirx closed 3 years ago
@matthiasirx : the modern page API only supports modern pages and modern pages only live in a single SitePages library per site. I think you're referring to classic pages (wiki, web part, publishing). You can consider modernizing these classic pages into modern pages, see https://aka.ms/sharepoint/modernization/pages
@jansenbe Indeed the second library is for classic wiki pages, which cannot be converted for the time being. But with those two page libraries within the same site, the pages api selects the wrong library, so I can't use the Page cmdlets anymore. Add-PnPPage even creates the pages in the wrong library and then fails with an error afterwards.
@matthiasirx : you're right, the wiki page library and site pages library are of the same type, so having a wiki page library might result in the modern page API picking the wrong library. Flagged as bug which I'll tackle once we're done with a fairly big refactoring
@matthiasirx : just fixed this issue, next nightly should correctly identify the site pages library
Category
Describe the bug
In a site with multiple page libraries, all page related cmdlets (Get-PnpPage, Export-PnPPage, ...) always use the (alphabetically?) first library. I was able to trace this back to this commit: https://github.com/pnp/pnpcore/commit/dd43f2fa1943495449c0e517419666cc5049e45d
In my case I have a page library "Classic Pages" and the default "Site Pages".
Get-PnPPage Home.aspx
fails since it is looking at Classic Pages library. Same withGet-PnPPage SitePages/Home.aspx
Steps to reproduce
Create a second page library "Classic Pages".
Expected behavior
It should be possible to specify which page library is used.
Environment details (development & target environment)
PnP.PowerShell 1.3.0 Windows 10 PowerShell 5