SharePoint copy off home page

Modified on Wed, 24 Jan, 2024 at 1:11 PM

PowerShell 7.4.0

PS C:\Program Files\PowerShell\7> Import-Module PnP.PowerShell

PS C:\Program Files\PowerShell\7> $SourceSiteURL = "https://rsaacademy.sharepoint.com/sites/AVAStaffShared"

PS C:\Program Files\PowerShell\7> $DestinationSiteURL = "https://rsaacademy.sharepoint.com/sites/HHS-StaffShared"

PS C:\Program Files\PowerShell\7> $PageName = "Home.aspx"

PS C:\Program Files\PowerShell\7> Connect-PnPOnline -Url $SourceSiteURL -Interactive

PS C:\Program Files\PowerShell\7> $TempFile = [System.IO.Path]::GetTempFileName()

PS C:\Program Files\PowerShell\7> Export-PnPPage -Force -Identity $PageName -Out $TempFile

PS C:\Program Files\PowerShell\7> Connect-PnPOnline -Url $DestinationSiteURL -Interactive

PS C:\Program Files\PowerShell\7> Invoke-PnPSiteTemplate -Path $TempFile

PS C:\Program Files\PowerShell\7> $SourceSiteURL = "https://rsaacademy.sharepoint.com/sites/AVAStudentShared"

PS C:\Program Files\PowerShell\7> $DestinationSiteURL = "https://rsaacademy.sharepoint.com/sites/HHS-StudentShared"

PS C:\Program Files\PowerShell\7> $PageName = "Home.aspx"

PS C:\Program Files\PowerShell\7> Connect-PnPOnline -Url $SourceSiteURL -Interactive

PS C:\Program Files\PowerShell\7> $TempFile = [System.IO.Path]::GetTempFileName()

PS C:\Program Files\PowerShell\7> Export-PnPPage -Force -Identity $PageName -Out $TempFile

PS C:\Program Files\PowerShell\7> Connect-PnPOnline -Url $DestinationSiteURL -Interactive

PS C:\Program Files\PowerShell\7> Invoke-PnPSiteTemplate -Path $TempFile

PS C:\Program Files\PowerShell\7>      

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article