| external help file | Microsoft.Online.SharePoint.PowerShell.dll-Help.xml |
|---|---|
| Module Name | Microsoft.Online.SharePoint.PowerShell |
| online version | https://learn.microsoft.com/powershell/module/microsoft.online.sharepoint.powershell/add-spositescript |
| applicable | SharePoint Online |
| title | Add-SPOSiteScript |
| schema | 2.0.0 |
| author | samkabue |
| ms.author | speedta |
| ms.reviewer |
Uploads a new site script for use either directly or in a site design.
Add-SPOSiteScript -Title <String> -Content <String> [-Description <String>] [<CommonParameters>]
Uploads a new site script for use either directly or in a site design.
This example adds a new site logo from the following script in a file.
{
"$schema": "schema.json",
"actions": [
{
"verb": "setSiteLogo",
"url": "https://contoso.sharepoint.com/SiteAssets/company-logo.png"
}
]
}Get-Content 'c:\scripts\site-script.json' -Raw | Add-SPOSiteScript -Title "Customer logo" -Description "Applies customer logo for customer sites"This example sets the external sharing capabilities of the site to the ExternalUserAndGuestSharing option. We also add a site design for a Communication site (68) which uses this script.
$script = @'
{
"$schema": "schema.json",
"actions": [
{
"verb": "setSiteExternalSharingCapability",
"capability": "ExternalUserAndGuestSharing"
}
],
"bindata": { },
"version": 1
};
'@
Add-SPOSiteScript -Title "External User and Guest Sharing site script" -Description "A site script to manage the
guest access of a site" -Content $scriptId : ea9e3a52-7c12-4da8-a901-4912be8a76bc
Title : External User and Guest Sharing site script
Description : A site script to manage theguest access of a site
Content :
Version : 0Add-SPOSiteDesign -Title "Communication Site with External Users and Guest Sharing" -WebTemplate "68" -SiteScripts "ea9e3a52-7c12-4da8-a901-4912be8a76bc"Applicable: SharePoint Online
The JSON value that describes the script. For more information, see the JSON reference.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseApplicable: SharePoint Online
A description of the script.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseApplicable: SharePoint Online
The display name of the site design.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.