The process of building custom applications and tools that interact with Microsoft SharePoint, including SharePoint Online in Microsoft 365.
Please follow below tips to troubleshoot the issue.
1.Ensure you are using the latest version of the PnP PowerShell module. Older versions might have bugs or missing features.
Update-Module -Name PnP.PowerShell
2.Make sure that the account you're using to connect to the destination site has the necessary permissions to apply the template. The account need to be a site collection administrator or have similar elevated permissions.
3.Use following PowerShell to apply PnP Templates to SharePoint site.
Connect-PnPOnline https://<tenant>.sharepoint.com/sites/<URL-of-your-target-site> -Interactive
Invoke-PnPTenantTemplate -Path .\your-template-file.pnp -Parameters @{"SiteTitle"="<Title-of-your-target-site>";"SiteUrl"="/sites/<URL-of-your-target-site>"}
Note: Replace <tenant> with the actual name of your SharePoint Online tenant in Microsoft 365. Remember to provide a value for all the parameters declared in the above table.
4.Check errors in Verbose mode.
Run the Invoke-PnPTenantTemplate command with the -Verbose flag to get more detailed output. This can help identify any specific errors.
Invoke-PnPTenantTemplate -Path "Provisioning.pnp" -Verbose
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.