Forum Discussion
Blair24
Dec 07, 2018Copper Contributor
PnP Get Site Template - Object reference not set to an instance of an object
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:
5 Replies
Sort By
- Tom CastigliaIron ContributorHi 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.- Blair24Copper ContributorHi 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.- Tom CastigliaIron ContributorYup, same here! Thanks.
- Thuyavan GanesanSteel ContributorHi 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- Blair24Copper Contributor
Hi Thuyavan,
Sadly that fails as well! Have tried it in a: Function App, PowerShell ISE and standard PowerShell. Same result every time sadly...