How can I backup my SharePoint pages resided in the Site pages library of my Communication site using PnP PowerShell?
1 Answer
PnP PowerShell available to copy a modern page to another site:
#Parameters
$SourceSiteURL = "https://crescent.sharepoint.com/sites/marketing"
$DestinationSiteURL = "https://crescent.sharepoint.com/sites/branding"
$PageName = "About.aspx"
#Connect to Source Site
Connect-PnPOnline -Url $SourceSiteURL -Interactive
#Export the Source page
$TempFile = [System.IO.Path]::GetTempFileName()
Export-PnPPage -Force -Identity $PageName -Out $TempFile
#Import the page to the destination site
Connect-PnPOnline -Url $DestinationSiteURL -Interactive
Invoke-PnPSiteTemplate -Path $TempFile
Export-PnPPage
instead ofExport-PnPClientSidePage
based on version of PnP PowerShell you are using.Get-PnPFile
works for you: sharepoint.stackexchange.com/questions/277383/…