[BUG] Invoke-PnPSiteTemplate directly raises an exception upon calling
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 259
- Forks
- 161
- Avg merge
- 10h 33m
- Merged PRs (30d)
- 1
Description
Reporting an Issue or Missing Feature
Issue
Expected behavior
The given site template is deployed to the web I am connected to.
Actual behavior
When I launch the command, I have immediately this error and the template is not deployed.

Step to reproduce
I created the template with following command:
Get-PnPSiteTemplate -Out template-out.xml -ListsToExtract "list_A","list_B","list_C" -ContentTypeGroups "MyGroup" -Handlers "ContentTypes","Features","Fields","Lists","PageContents","PropertyBagEntries"
Once created I directly used the output template with Invoke-PnpSiteTemplate and got the error (no change made to the file).
Both commands were OK untill now (template creation + deployment), with same options, but I was stuck recently because of this issue https://giters.com/pnp/pnpframework/issues/722
I wanted to try last version which contains the fix.
What is the version of the Cmdlet module you are running?
Powershell 7.2.6
PnP.Powershell 1.12.0

Which operating system/environment are you running PnP PowerShell on?
Windows 10 Enterprise 21H2, build 19044.2130
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure with Invoke-PnPSiteTemplate using the template produced by Get-PnPSiteTemplate and the listed handlers. Compare the exception in the attached screenshot with the earlier issue 722; done means the generated template deploys successfully with PnP.Powershell 1.12.0 and the reported options.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100