spo sitescript add¶
Adds site script for use with site designs
Usage¶
spo sitescript add [options]
Options¶
Option | Description |
---|---|
--help |
output usage information |
-t, --title <title> |
Site script title |
-c, --content <content> |
JSON string containing the site script |
-d, --description [description] |
Site script description |
-o, --output [output] |
Output type. json|text . Default text |
--verbose |
Runs command with verbose logging |
--debug |
Runs command with debug logging |
Important
Before using this command, log in to a SharePoint Online site, using the spo login command.
Remarks¶
To add a site script, you have to first log in to a SharePoint site using the spo login command, eg. spo login https://contoso.sharepoint.com
.
Each time you execute the spo sitescript add
command, it will create a new site script with a unique ID. Before creating a site script, be sure that another script with the same name doesn't already exist.
Examples¶
Create new site script for use with site designs. Script contents are stored in the $script
variable
spo sitescript add --title "Contoso" --description "Contoso theme script" --content $script
More information¶
- SharePoint site design and site script overview: https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-overview