-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add-PnPPage: Object reference not set to an instance of an object when trying to create a new page #3959
Comments
@jansenbe should |
Can i create the library manually some way? Thanks |
Having the exact same issue with the dotnet sdk, any workarounds? |
https://www.sharepointdiary.com/2021/06/create-site-pages-library-in-sharepoint-online.html Maybe this helps ? You might have to activate the feature manually. |
I submitted a possible fix (activating the "Site Pages" feature if not active) in the PnP Core repository. I guess we could activate it in the Commandlet too, but feels much cleaner if it's done in the right place. |
Category
Describe the bug
Im trying to migrate a classic site into a modern one. I already have the connected 365 group and i can use modern lists and libraries. But i have pages, like the homepage that are classic and when this page is displayed the menu is the classic one too so the user is confused. I dont want to migrate any of those pages, i tried and get other errors so i delete all of them. Now, im trying to create a new modern page using PnP. Im using command Add-PnPPage.
Steps to reproduce
Connect-PnPOnline -Url "https://----.sharepoint.com/calidad" -Credential (Get-Credential)
$pagename = "Welcome"
$page = Add-PnPPage -Name $pagename -LayoutType Home
Add-PnPPage: Object reference not set to an instance of an object.
Expected behavior
The modern page to be created. A file is created instead but is corrupted.
Environment details (development & target environment)
Additional context
What i want to achieve is my users only have to see one menu, and not be changing between different designs. I can't recreate the entire site because it has a lot of list with powerautomate flows.
The text was updated successfully, but these errors were encountered: