To move pages from one site to another (SharePoint Online, modern), I use the PnP PowerShell commands below:
Export-PnPPage -Identity $pageName -Force -Out $tempFile
Invoke-PnPSiteTemplate -Path $tempFile
The problem is, once the page is on the destination site, all the links have been changed so they point to the destination site. I understand that this is typically desirable, but in this case I need to them to stay constant. Does anyone know of a way to do this?
I have been looking for other commands to maybe get the text of the page, have PowerShell find and replace the links back to the original, and then write the text back, but I don't think that's possible with PnP PowerShell.
Any help would be appreciated.