logo
search
SharePoint Document Issues

How to Add SharePoint Site Pages to an Automated Site Template

Algirdas JasaitisAlgirdas Jasaitis Oct 10, 2026 869 views

Question details

The user needs a way to include preconfigured home pages and populated Site Pages in an automated SharePoint site template.

How to Add SharePoint Site Pages to an Automated Site Template
Product
Microsoft SharePoint
Device & OS
not provided
Scenario
Automating the creation of new SharePoint sites and attempting to include custom page layouts and content in the deployment templates.
Observed behavior
The Get-SPOSiteScriptFromWeb command generates structural scripts for the Site Pages list but fails to capture and reproduce the actual content within those pages.
Before you start

Ensure you have SharePoint administrator privileges and have installed the latest version of PnP PowerShell before attempting to provision custom site pages.

Solution 1Recommended

Use PnP PowerShell to Provision Site Pages

Since native site scripts do not capture page content, PnP PowerShell provides a robust alternative to export and apply complete site page templates.

PnP (Patterns and Practices) PowerShell extends standard SharePoint administration by offering deep provisioning capabilities. It can successfully extract modern site pages, including web parts and content, which native Site Scripts simply omit.

1
Install PnP PowerShell

Open PowerShell as an administrator and run 'Install-Module PnP.PowerShell' to ensure you have the latest cmdlets.

2
Connect to Source Site

Authenticate to your perfectly configured source SharePoint site using 'Connect-PnPOnline -Url <YourSiteURL> -Interactive'.

3
Export Site Template

Run 'Get-PnPSiteTemplate -Out template.xml -IncludeAllClientSidePages' to extract the site structure along with the content of all modern site pages.

4
Apply Template to Target Site

Connect to your newly created destination site and run 'Invoke-PnPSiteTemplate -Path template.xml' to populate it with the preconfigured pages.

Use PnP PowerShell to Provision Site Pages
Complete Provisioning: The PnP provisioning engine automatically handles the extraction and deployment of web parts, ensuring the new site exactly mirrors the original layout.
Free Microsoft Office alternative

Draft Content Seamlessly with WPS Office

While configuring complex SharePoint automations, you still need a reliable tool for drafting the documents that will populate those sites. WPS Office is a fast, lightweight, and completely free alternative to Microsoft Office.

  1. 1. Download the Installer: Visit the official WPS Office website to download the free installation package for your operating system.
  2. 2. Create or Edit Files: Open WPS Office to instantly start a new document or edit your existing Microsoft Office files without formatting loss.
  3. 3. Save and Upload: Save your work in standard Office formats and easily upload them directly to your newly provisioned SharePoint document libraries.
Fully compatible with Microsoft Word, Excel, and PowerPoint file formats (.docx, .xlsx, .pptx).Lightweight installation with incredibly fast startup times.Familiar tabbed interface that requires zero learning curve.Create rich document content seamlessly before uploading to your automated SharePoint sites.
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't Get-SPOSiteScriptFromWeb include page content?

The Get-SPOSiteScriptFromWeb cmdlet is specifically designed to capture the structural elements of a site, such as lists, libraries, themes, and navigation configurations. It is not intended to copy individual document content, list items, or site page contents.

Can I use Power Automate to copy SharePoint Site Pages?

Yes, Power Automate can be combined with SharePoint REST API calls or HTTP requests to trigger page creation and duplicate page content, though utilizing PnP PowerShell remains the industry standard for comprehensive site template deployments.

What is the difference between a SharePoint Site Script and a Site Template?

A Site Script is a JSON file detailing specific programmatic actions to apply (like creating a list or setting a theme). A Site Template (formerly called a Site Design) is the overarching package presented to users, which can execute one or multiple Site Scripts upon the site's creation.