"Method Not Found" Error while using Get-PnPSiteTemplate

Viewed 891

I am trying to extract a site template of our site(based on the Communication site template) and restore it onto a new one. Whenever I run the below command, I am seeing an error as below

Get-PnPSiteTemplate -Out "C:\bin\ONNProd.xml" -Handlers PageContents,Lists,Pages,Theme,Fields -IncludeAllPages

Get-PnPSiteTemplate : Method not found: 'System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1<Boolean> Enumerator.MoveNextAsync()'.  

Checking the version of PnP.Powershell using Get-Module -Name PnP.PowerShell gives me as 1.7.0

Can some one help me what am i missing?

1 Answers

Sounds like there is a bug with the most recent version (v1.7 and possible v1.6) of PNP.PowerShell for this function. I was able to successfully get this to run by installing the 1.5 version.

Run this to install:

Install-Module PNP.PowerShell -RequiredVersion 1.5.0 -AllowClobber  
Related