Apply-PnPProvisioningTemplate error when providing URL to pnp file in SharePoint

Occasional Contributor

I looked at the samples and source code and it does show you can use a SharePoint doc library to hold the XML template as a .pnp file when passing in the -Path parameter, however I am getting an error.


Apply-PnPProvisioningTemplate -Path -Handlers Navigation -ClearNavigation:$true
I get this error then:  Object reference not set to an instance of an object
It works fine if it is a local file
Has anyone successfully used the Apply-PnPProvisioningTemplate command with a SP URL for the path?
1 Reply



Did you ever get this to work.  I am revisiting some deployment scripts I successfully tested a few months ago  and I am getting the same error - I have created an issue on GIT to follow this up.


Apply-PnPProvisioningTemplate : Object reference not set to an instance of an object.
At D:\Dev\Clients\WSL\The Volt SP Starter Kit Non FR\provisioning\Apply-WSLSiteDesignsOrScripts.ps1:69
+ Apply-PnPProvisioningTemplate -Path WSLProvisioningSDTemplate.xml
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [Apply-PnPProvisioningTemplate], NullReferenceException
+ FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Provisioning.ApplyProvisioningTempl