0

I have 2 SharePoint Online tenants which both have a modern communication sites. now i used this command to get the source site template:-

PS C:\Users\mohan> Connect-PnPOnline -Url "https://ssms.sharepoint.com/sites/PPM-test/" -Interactive 
PS C:\Users\mohan> Get-PnPSiteTemplate -Out "PnP-Provisioning-F.xml"

and i got this file:-

image

but when i try to apply the site template to the destination site using this command:-

PS C:\Users\mohan> Connect-PnPOnline -Url "https://destination.sharepoint.com/sites/PPM-test/" -Interactive 
PS C:\Users\mohan> Invoke-PnPTenantTemplate -Path "PnP-Provisioning-F.xml"

The command shows the following text: -

"initializing engine....Applying Template... "

then it ends after 2 seconds, without applying anything to the destination.. so, what can be causing this issue?

My Powershell version is PowerShell 7.4.2

1 Answer 1

0

It seems that the Invoke-PnPTenantTemplate command is not applying the template to the destination site. One possible reason for this issue is that the PnP PowerShell module is not properly authenticated to access the destination site. To resolve this issue, you can try connecting to the destination site using the Connect-PnPOnline command before running the Invoke-PnPTenantTemplate command. Here's an example:

Connect-PnPOnline -Url https://yourtenant.sharepoint.com/sites/destination-site
Invoke-PnPTenantTemplate -Path "C:\Development\template.xml"
1
  • I am already doing this as per my code. also when i added verbose paramters as follow, the Invoke-PnPTenantTemplate -Verbose, i got this error Access token acquired Commented Jul 18 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.