Copy SharePoint Page Content – Powershell

We recently had a project that needed 164 SharePoint sites to be created across development, testing, and production environments. The sites would be created prior (with other scripts on the blog here), but other assets needed to be uploaded or synced as well. In order to accomplish the task, I wrote this PowerShell function to copy the page content of one SharePoint page to another.

Example:

The function will check both targets to confirm there is content to copy, and a destination for it. If anything is missing, it will abort and alert you:

SharePoint content could not be copied.

If successful, you will see output like this:

Output for successful command.

 

Leave a Reply

Your email address will not be published.