Skip to content

spo list sitescript get

Extracts a site script from a SharePoint list

Usage

spo list sitescript get [options]

Options

Option Description
--help output usage information
-u, --webUrl <webUrl> URL of the site where the list to extract the site script from is located
-l, --listId [listId] ID of the list to extract the site script from. Specify either listId or listTitle but not both
-t, --listTitle [listTitle] Title of the list to extract the site script from. Specify either listId or listTitle but not both
-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 extract a site script from a list, you have to first log in to SharePoint using the spo login command, eg. spo login https://contoso.sharepoint.com.

Examples

Extract a site script from an existing SharePoint list with title ContosoList located in site https://contoso.sharepoint.com/sites/project-x

spo list sitescript get --webUrl https://contoso.sharepoint.com/sites/project-x --listTitle ContosoList

Extract a site script from an existing SharePoint list with id cc27a922-8224-4296-90a5-ebbc54da2e85 located in site https://contoso.sharepoint.com/sites/project-x

spo list sitescript get --webUrl https://contoso.sharepoint.com/sites/project-x --listId cc27a922-8224-4296-90a5-ebbc54da2e85