question

ReneWagner-1403 avatar image
0 Votes"
ReneWagner-1403 asked

Get-PnPProvisioningTemplate : Sequence contains no matching element

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


windows-server-powershell
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers