I try to export and import template using below PnP powershell scripts. There is no issue while exporting the template. But I get "Apply-PnPProvisioningTemplate : Input string was not in a correct format." message while applying template to target site collection. I couldn't find any error message in the log file. How can I solve this issue?
Export:
Connect-PnPOnline –Url https://tenant.sharepoint.com/sites/sourcesitecoll –Credentials (Get-Credential)
Get-PnPProvisioningTemplate -out template.pnp
Import:
Connect-PnPOnline –Url https://tenant.sharepoint.com/sites/targetsitecoll –Credentials (Get-Credential)
Set-PnPTraceLog -On -LogFile "C:\Works\PnP\logs.txt" -Level Debug
Apply-PnPProvisioningTemplate -Path "C:\Works\PnP\template.pnp"
Error message:
Apply-PnPProvisioningTemplate : Input string was not in a correct format. At line:1 char:1 + Apply-PnPProvisioningTemplate -Path "C:\Works\PnP\template.pnp ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : WriteError: (:) [Apply-PnPProvisioningTemplate], FormatException + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Provisioning.Site.ApplyProvisioningTemplate
SharePointPnPPowerShellOnline version is "3.10.1906.0"