Set-SPOSiteScript

Updates a previously uploaded site script.

Syntax

Set-SPOSiteScript
    -Identity <SPOSiteScriptPipeBind>
    -Title <string>
    -Content <string>
    [-Description <string>]
    [-Version <Int32>] 
   [<CommonParameters>]

Description

Updates a previously uploaded site script.

Examples

Example 1

This example updates a previously created site script. Any site designs referencing it execute the updated script.

$newnavscript = @'
{
    "$schema": "schema.json",
        "actions": [
            {
                "verb": "addNavLink",
                "url": "/Custom Library",
                "displayName": "Custom Library Updated",
                "isWebRelative": true
            },
            {
                "verb": "addNavLink",
                "url": "/Lists/Custom List",
                "displayName": "Custom List Updated",
                "isWebRelative": true
            },
            {
                "verb": "applyTheme",
                "themeName": "Contoso Explorers"
            }
        ],
            "bindata": { },
    "version": 2
};
'@

Set-SPOSiteScript -Identity edaec4ec-71e2-4026-ac1e-6686bb30190d -Content $newnavscript -Version 2

Parameters

-Content

The JSON value that describes the script. For more information, see the JSON reference.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Online

-Description

A description of the script.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Online

-Identity

The id of the site design.

Type:SPOSiteDesignPipeBind
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Online

-Title

The display name of the site design.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Online

-Version

A version number of the script.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Online