pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
990 stars 663 forks source link

[BUG] XML template modified when packaged .pnp file #2831

Open ypcode opened 4 years ago

ypcode commented 4 years ago

Expected behavior

Save-PnPTemplate to save a .pnp package file from a PnP Template XML should not alter the original source XML

Actual behavior

after spotting an issue with AllowExternalSharing , I realized the parameter was not in my template but got added in the XML included in the .pnp file

The original file is here while the file I extracted from the .pnp file looks like this

Steps to reproduce behavior

I use the following commands to create a .pnp file from an XML template and its related .sppkg asset

# Rebuild the .pnp file with the latest sppkg and tenant template
Set-Location ../PnPPowershell/debug/
$pnpTemplate = Read-PnPTenantTemplate -Path $pnpTemplateXmlFileName
Save-PnPTenantTemplate -Template $pnpTemplate -Out $pnpPackageFileName -Force
Move-Item $pnpPackageFileName .. -force | Out-Null
# Delete the temp package file
Remove-Item -force -recurse package
Write-Host "PnP setup package built." -ForegroundColor Green

Which version of the PnP-PowerShell Cmdlets are you using?

What is the version of the Cmdlet module you are running?

3.22.2006.2

How did you install the PnP-PowerShell Cmdlets?