Edit

Share via


Get-SPOSiteScriptFromWeb

Creates site script syntax from an existing SharePoint site.

Syntax

Default (Default)

Get-SPOSiteScriptFromWeb
    [-WebUrl] <String>
    [-IncludedLists <String[]>]
    [-IncludeBranding]
    [-IncludeTheme]
    [-IncludeRegionalSettings]
    [-IncludeSiteExternalSharingCapability]
    [-IncludeLinksToExportedItems]
    [<CommonParameters>]

Description

Uses an existing SharePoint site to output a JSON blob that can be used to create a site script for use in a site design.

Examples

Example 1

This example creates the site script output from an existing site - and writes it to a variable. This variable is then referenced to create a site script.

C:\> $extracted = Get-SPOSiteScriptFromWeb `
    -WebUrl https://contoso.sharepoint.com/sites/template `
    -IncludeBranding `
    -IncludeTheme `
    -IncludeRegionalSettings `
    -IncludeSiteExternalSharingCapability `
    -IncludeLinksToExportedItems `
    -IncludedLists ("Shared%20Documents", "Lists/Project%20Activities")
C:\> Add-SPOSiteScript `
    -Title "Contoso template site" `
    -Description "This is a copy of a site collection." `
    -Content $extracted

Parameters

-IncludeBranding

Applicable: SharePoint Online

A switch that if provided, extracts the configuration of the site's branding.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IncludedLists

Applicable: SharePoint Online

An array of one or more lists. Each is identified by the list url.

Note: Currently, navigation nodes are not exported.

Parameter properties

Type:

System.String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IncludeLinksToExportedItems

Applicable: SharePoint Online

A switch that if provided, extracts navigation links. In order to export navigation links pointing to lists, the list needs to be included in the request as well.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IncludeRegionalSettings

Applicable: SharePoint Online

A switch that if provided, extracts the site's regional settings.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IncludeSiteExternalSharingCapability

Applicable: SharePoint Online

A switch that if provided, extracts the site's external sharing capability.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IncludeTheme

Applicable: SharePoint Online

A switch that if provided, extracts the site's custom theme by using the themeJson property.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WebUrl

Applicable: SharePoint Online

The url that starts with HTTPS of the site to retrieve the site script.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

System.Object