Hello,
I am working on a PnP PowerShell Provisioning script for SP 2016 (on-prem) and have been pretty successful in getting the script to work. My script supports both extracting a template from a site and deploying that template to a new target site.
While testing the extraction against a template site that we have configured I am encountering the following error:
Running extract process ...
Get-PnPProvisioningTemplate : Sequence contains no matching element
At C:\Temp\WEC\WEC-PnPProvisioner.ps1:929 char:9
+ Get-PnPProvisioningTemplate -Out "C:\temp\WEC\PnP-WECBase-Fil ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [Get-PnPProvisioningTemplate], InvalidOperationException
+ FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Provisioning.Site.GetProvisioningTemplate
This is happening while the script is executing the call
Get-PnPProvisioningTemplate -Out "C:\temp\PnP-Base-File.xml" -Handlers All -IncludeHiddenLists -IncludeSearchConfiguration -PersistPublishingFiles -IncludeAllClientSidePages
The same script works fine when used against other site templates, so it appears to be something specific to this particular site template. Any idea how to determine what is causing the actual issue?
I found an old reference to a GitHub post here that refers to a possible bug related to the HiddenTaxonomy list on the site (https://github.com/SharePoint/sp-dev-docs/issues/1153) if there is a null value in the list, but I checked the list and all the entries appear to be valid.
Any ideas appreciated.
Thanks