Get-PnPProvisioningTemplate : The file is not checked out. You must first check out this document..

%3CLINGO-SUB%20id%3D%22lingo-sub-32420%22%20slang%3D%22en-US%22%3EGet-PnPProvisioningTemplate%20%3A%20The%20file%20is%20not%20checked%20out.%20You%20must%20first%20check%20out%20this%20document..%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-32420%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20trying%20to%20get%20a%20template%20using%20the%20latest%20PnP%20PowerShell%20release%20with%20Get-PnPProvisioningTemplate.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20getting%20the%20following%20error%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EGet-PnPProvisioningTemplate%20%3A%20The%20file%20is%20not%20checked%20out.%20You%20must%20first%20check%20out%20this%20document%20before%20making%20changes.%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3EAt%20C%3A%5CPVSource%5CZephyrDemoIntranet%5CupdateAll.ps1%3A12%20char%3A1%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%2B%20Get-PnPProvisioningTemplate%20-Out%20C%3A%5CPVSource%5Ctempl%20...%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%2B%20CategoryInfo%20%3A%20WriteError%3A%20(%3A)%20%5BGet-PnPProvisioningTemplate%5D%2C%20ServerException%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%2B%20FullyQualifiedErrorId%20%3A%20EXCEPTION%2CSharePointPnP.PowerShell.Commands.Provisioning.GetProvisioningTemplate%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAfter%20I%20enabled%20debug%20I%20can%20see%20that%20the%20problem%20is%20something%20to%20do%20with%20the%20page%20contents%20of%20the%20page%20that%20I'm%20trying%20to%20export.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20even%20though%20it%20doesn't%20make%20any%20sense%2C%20I%20checked%20out%20my%20welcome%20page%20and%20now%20the%20%3CSPAN%3EGet-PnPProvisioningTemplate%26nbsp%3B%3C%2FSPAN%3Eworks%26nbsp%3Bas%20expected.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20haven't%20exported%20a%20publishing%20site%20for%20a%20while.%20Has%20anyone%20else%20seen%20the%20same%20issue%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-32420%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPnP%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
MVP

I'm trying to get a template using the latest PnP PowerShell release with Get-PnPProvisioningTemplate.

 

I'm getting the following error:

 

Get-PnPProvisioningTemplate : The file is not checked out. You must first check out this document before making changes.
At C:\PVSource\ZephyrDemoIntranet\updateAll.ps1:12 char:1
+ Get-PnPProvisioningTemplate -Out C:\PVSource\templ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [Get-PnPProvisioningTemplate], ServerException
+ FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Provisioning.GetProvisioningTemplate

 

After I enabled debug I can see that the problem is something to do with the page contents of the page that I'm trying to export.

 

So even though it doesn't make any sense, I checked out my welcome page and now the Get-PnPProvisioningTemplate works as expected. 

 

I haven't exported a publishing site for a while. Has anyone else seen the same issue?

0 Replies