Forum Discussion
An_admin_123
Apr 11, 2023Copper Contributor
Converting classic pages to modern
I am migrating SharePoint from on-premises to on-line. The process has copied lots of pages over which are in the classic mode and I want to convert them to modern. I really don't have time to recr...
An_admin_123
Apr 18, 2023Copper Contributor
https://learn.microsoft.com/en-us/sharepoint/dev/transform/modernize-userinterface-site-pages-powershell
I took the script from there and tried to use it. Of course, I'm not a programmer (or interested in being one) so it's all a little out of my usual scope. I only changed the address it points at.
The line
$pages = Get-PnPListItem -List sitepages -PageSize 500
seems relevant. If I change sitepages to site pages it says:
A positional parameter cannot be found that accepts argument 'pages'.
I have a "Site Pages" page library in Site Contents.
I took the script from there and tried to use it. Of course, I'm not a programmer (or interested in being one) so it's all a little out of my usual scope. I only changed the address it points at.
The line
$pages = Get-PnPListItem -List sitepages -PageSize 500
seems relevant. If I change sitepages to site pages it says:
A positional parameter cannot be found that accepts argument 'pages'.
I have a "Site Pages" page library in Site Contents.
ganeshsanap
Apr 19, 2023MVP
An_admin_123 Document library display name and internal name (URL name) can be different in SharePoint. So, use this:
$pages = Get-PnPListItem -List "Site Pages" -PageSize 500Where there is a space in display name of list/library, you have to enclose it inside double quotes as shown above.
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs
- An_admin_123Apr 19, 2023Copper ContributorYes! It seems the command is case sensitive too. I had tried but it has to be "Site Pages", not "site pages". Now it runs at least, even if it doesn't seem to achieve much. It claims to have convereted the pages but they look the same.