Apply-PnPProvisioningTemplate stuck

Today I used PnP PowerShell to provision one of my sites. For some reason my Apply-PnPProvisioningTemplate  CmdLet just didn’t want to run properly. Every time I ran Apply-PnPProvisioningTemplate it would just hang on Initializing engine.  I enabled the debugging for my PnP Powershell, but still I didn’t have much luck finding out what was happening.

How do you possible debug this? In my situation it was working in 2 other ‘identical’ SharePoint 2016 farms and I wasn’t able to run any Visual Studio debugger in this environment.

After a while ( about 5 or 10 minutes) I did get an error message:

apply-pnpprovisioningtemplate : field or property “groupid” does not exist.

But this is very little help!

Time to look at the Template that I’m trying to provision. The only place I found GroupId properties were Taxonomy fields. It there a problem with my Managed Metadata Service?

 

Like I said earlier my farms are identical, therefore it is a bit of a surprise that on this 3rd farm things aren’t working as expected. Usually PnP Powershell is my friend and it looks like my friend is letting me down! Sometime you just have to convince your friends that it is a good idea to play!

PnP PowerShell versions

One small difference is that I’m using a different version of PnP PowerShell on this 3rd farm. As the 3rd farm was installed slightly later than the others. I had to install PnP PowerShell yesterday on a machine local to this farm.  Just to make sure that it isn’t something related to the version of my PnP PowerShell, I decided to export an existing site with Get-PnPProvisionigTemplate so that I can compare the template generated by the new version of PnP Powershell and the older version of PnP PowerShell. I was however, getting a similar error message but now Get-PnPProvisioningTemplate was complaining about a property “ListExperienceOptions”

This  is giving me a great clue! ListExperienceOptions are not relevant for SharePoint 2016! So I checked the version of PnP Powershell that was installed

I quickly uninstalled the Online version of PnP PowerShell and I installed the SharePoint 2016 version.

Once I had the right version of PnP PowerShell scripts installed all started working! Hopefully this will help you if you make a mistake like I did and install the wrong version of PnP Powershell.

Advertisements