Fix Get-SPOSiteScriptFromWeb Not Including SharePoint Site Pages
Question details
The user is attempting to generate a SharePoint site script that includes pre-populated site pages and corporate training content, but the exported script fails to include the page contents and navigation.

- Product
- Microsoft SharePoint
- Device & OS
- Windows 10
- Scenario
- Generating a reusable template site pre-populated with customized pages, project FAQs, and corporate training content for new project teams.
- Observed behavior
- The generated site script using Get-SPOSiteScriptFromWeb only creates or updates the Site Pages list layout, completely missing the actual pages, hub settings, and document content.
Ensure you have SharePoint administrative permissions and the SharePoint Online Management Shell installed, as running administrative PowerShell scripts is required to alter site custom script settings.
Modify the Get-SPOSiteScriptFromWeb IncludedLists Parameter
Use this solution to ensure that the basic list structure for Site Pages is included in the site script.
Site scripts are generally designed to create structural layouts, lists, columns, and views rather than copying actual page or document content. Hub navigation cannot be included because it is dynamically managed by the associated hub.
Launch the SharePoint Online Management Shell as an administrator.
Execute the Get-SPOSiteScriptFromWeb command and explicitly include the SitePages list in the IncludedLists parameter to capture the list layout.
Save the Entire Site as a Template with Content
Use this alternative method if you require actual document content, customized site pages, and FAQs to be duplicated to newly created sites.
Create Corporate Training Content with WPS Office
While SharePoint handles site deployment, creating the actual training documents and project FAQs is easier with a reliable productivity suite. WPS Office is a free, lightweight, and highly compatible alternative to Microsoft Office, making document creation a breeze.
- 1. Download the Installer: Visit the WPS Office website and click 'Download WPS Office Free' to get the installer for your device.
- 2. Install WPS Office: Run the lightweight installer and follow the on-screen prompts to complete the setup.
- 3. Create Your Content: Open WPS Office to instantly start writing and formatting your project templates and documents, then upload them to your SharePoint library.

Frequently Asked Questions
Why doesn't Get-SPOSiteScriptFromWeb copy my document content?
Site scripts are fundamentally designed to deploy site architecture. They define structural components like lists, columns, views, and layouts, but they do not extract or copy physical files, documents, or the text inside site pages.
Can I include hub navigation in my SharePoint site script?
No, hub navigation cannot be included within an exported site script. Hub navigation is controlled and dynamically managed by the associated hub site, rather than by the individual site's local settings.
What are the requirements for saving a SharePoint site as a template with content?
To save a site as a template with content, you must have SharePoint administrative permissions, the site's Publishing feature must be disabled, and custom scripts must be allowed for the site via the Set-SPOsite PowerShell command.





