Add-SPOSiteScript
上傳新的網站腳本,以直接或在網站設計中使用。
Syntax
Add-SPOSiteScript
-Title <string>
-Content <string>
[-Description <string>]
[<CommonParameters>]
Description
上傳新的網站腳本,以直接或在網站設計中使用。
範例
範例 1
本範例會在 檔案中新增下列腳本中的新網站標誌。
{
"$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"
範例 2
本範例會將網站的外部共用功能設定為 ExternalUserAndGuestSharing 選項。 我們也會在使用此腳本的通訊網站 (68) 新增網站設計。
$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 $script
Id : 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 : 0
Add-SPOSiteDesign -Title "Communication Site with External Users and Guest Sharing" -WebTemplate "68" -SiteScripts "ea9e3a52-7c12-4da8-a901-4912be8a76bc"
參數
-Content
描述腳本的 JSON 值。 如需詳細資訊,請參閱 JSON 參考。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
-Description
腳本的描述。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |
-Title
網站設計的顯示名稱。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Online |