Microsoft Office SharePoint (2018–present) by Microsoft Corporation is licensed under CC
Microsoft site scripts allow users and administrators to automate the provisioning of "similar" SharePoint sites.
Site scripts are JSON formatted files.
Site scripts include "actions" that will modify a SharePoint site.
Site script actions include:
https://developer.microsoft.com/json-schemas/sp/site-design-script-actions.schema.json.
Example site script
Site scripts are added to a SharePoint tenant using the Add-SPOSiteScript command
Connect to the SharePoint administration site
Load the JSON text into a variable
Site designs can extend the SharePoint modern team site template(64) or the SharePoint modern communication site template (68).
Site designs are added to a SharePoint tenant using the ADD-SPOSiteDesign command (specifying one or more Site Script ids)
Add the Site Script and add the Site Design
Once the Site design has been created the out of the box "Create a Site" user experience will be updated
Select "Team Site" because the new Site Design is based on the team site template(64)
The "Contoso customer tracking" Site Design is available in the "Choose a design" drop down list.
Click the Finish button to create the new Site and to run the Site Scripts
The newly created site includes the "Customer Tracking" list
The Get-SPOSiteDesign command can be used to list the installed Site designs (and the ids assigned).
Site designs can be applied to an existing SharePoint site using the Invoke-SPOSiteDesign command.
Site contents before invoking site design
Invoke-SPOSiteDesign
Site contents after invoking site design
The Get-SPOSiteScriptFromWeb command extracts Site Script from an existing SharePoint site.
Running the Get-SPOSiteScriptFromWeb command
Get-SPOSiteScriptFromWeb results