PnP Get Site Template - Object reference not set to an instance of an object

Copper Contributor

Hey,

Wondering if anyone else has had a similar issue? Get the error "Object reference not set to an instance of an object" when running Get-PnPProvisioningTemplate. Have tried it both on PS & PS ISE, its on a Modern SharePoint Online Team Site.

 

Attached a screenshot of the error below:

 

Error.PNG

5 Replies
Hi Blair,

There is no defined solution for it "Object reference not set to an instance of an object" is vast. Try to run the PnP-PowerShell inside an AzureFunction and see if it go through.

Hope this helps ,
Thuyavan

Hi Thuyavan,

 

Sadly that fails as well! Have tried it in a: Function App, PowerShell ISE and standard PowerShell. Same result every time sadly...

Hi Blair -
I've been able to reproduce this as well. Its related to the PageContents handler. If you don't need the contents of your home page in your template you should be able to exclude that handler and it may work.

I'm curious if you are running this in an O365 tenant that is using Targeted Release? I have reproduced this error in 2 tenants using Targeted Release. But in another tenant not on Targeted Release I don't have this error.
Hi Tom

Yeah we have targeted release on our tenant. Although the issue seems to be fixed for ourselves when you upgrade the PnP PS module to 3.4.