So I have an issue while using the
Get-PnPProvisioningTemplate comandlet... So I can go through and create lists and doclibs and pages all over a site, and create the provisioning template and that works fine.
But as soon a I change one element on the /Home.aspx page, I will get:
Get-PnPProvisioningTemplate : Object reference not set to an instance of an object. At ...\SharePoint\PowerShellScripts\pnp provision\CreateTemplate.ps1:31 char:13 + Get-PnPProvisioningTemplate -Out $ptoTemplate + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : WriteError: (:) [Get-PnPProvisioningTemplate], NullReferenceException + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Provisioning.Site.GetProvisioningTemplate
I know its' the [Client Side Page Contents] section because I run my script with the
Set-PnPTraceLog -On -Level Debug on, and if I add the flag
-ExcludeHandlers PageContents it runs with no error. I.E:
Get-PnPProvisioningTemplate -ExcludeHandlers PageContents -Out $ptoTemplate
Even if I revert the Home.aspx to version created by the System version, it remains broken.
I am trying to build a template of a "Modern Team Site" if anyone think that might matter.
Additional information, I also ran the commands:
Connect-PnPOnline -Url https://balhblah.sharepoint.com/sites/TemplateSite Enable-PnPFeature -Identity 0c8a9a47-22a9-4798-82f1-00e62a96006e -Scope site
So that I could enable the
Content Organizer Drop Off Library on the site.
I was really just trying to add that Drop Off lib to the Home page when I discovered this issue. Not sure if that is somehow related.
Thanks in advance!