We’ve been trying to use PowerShell to provision a site on our TEST environment from SharePoint online lists defined on DEV environment. Unfortunately, I’ve hit a bit of a wall with the provisioning process – I’ve had problems with calculated fields and lookup fields. I’ve tried to apply the resulting provisioning template to the TEST environment, but this fails in Apply-PnPProvisioningTemplate with messages such as

Apply-PnPProvisioningTemplate : Value does not fall within the expected range.
At C:\Users\xx\Projects\Provisioning-VanDrivers\Apply-Provisioning.ps1:20 char:2
+     Apply-PnPProvisioningTemplate -Path $ProvisioningSource -Connecti ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [Apply-PnPProvisioningTemplate], ServerException
    + FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Provisioning.Site.ApplyProvisioningTemplate

This faithfully tells me the failing line in the PowerShell script, but not alas any context from the XML. I anticipate that the most straightforward way to reproduce the SharePoint “schema” is to use a very strict manual procedure involving copying of SharePoint list templates, with consequent loss of lookup field context. If you have any better ideas we’d be eager to hear them.

1 Answer 1


Can you please explain which version of PnP Powershell you are using.

This command is no longer use with PnP Powershell.

You can use below command instead of apply provisionging template.

Invoke-PnPSiteTemplate -Path template.xml -ResourceFolder c:\provisioning\resources

Please refer to the below link for more details. Invoke Pnp Site Template

Please mark as answer if it resolve your issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.