Add-SPOSiteScript
上传新网站脚本,以便直接或在网站设计中使用。
语法
Add-SPOSiteScript
-Title <string>
-Content <string>
[-Description <string>]
[<CommonParameters>]
说明
上传新网站脚本,以便直接或在网站设计中使用。
示例
示例 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 |