Forum Discussion

LucidBike1140's avatar
LucidBike1140
Iron Contributor
Aug 23, 2021
Solved

Invoke-PnPSiteTemplate Changes Page Links

To move pages from one site to another (SharePoint Online, modern), I use the PnP PowerShell commands below: Source site:       Export-PnPPage -Identity $pageName -Force -Out $tempFile   Desti...
  • LucidBike1140's avatar
    Aug 23, 2021

    I didn't notice at first that the URL for each link started with "{site}". After the export command executed, I was able to open up the temp file with Notepad and do a find-and-replace, replacing "{site}" with the full URL of the source site (https://company.sharepoint.com/sites/sitename). I then executed the second command to create the page on the destination site.


    It's worth noting that each link is listed twice, the first is the actual link while the second is what shows up when you hover over the link.

    a href="{site}/SitePages/sitepage.aspx" data-cke-saved-href="https://#company#.sharepoint.com/sites/#site#/SitePages/sitepage.aspx"

     

Resources