Add-SPOSiteScriptPackage
上传新的网站脚本包,以便直接或在网站设计中使用。
语法
Default (默认值)
Add-SPOSiteScriptPackage
-Title <String>
-ContentPath <String>
[-Description <String>]
[<CommonParameters>]
说明
上传新的网站脚本包,以便直接或在网站设计中使用。 包文件必须是包含网站脚本所需的所有文件的 zip 存档。 此 zip 文件中必须存在带有脚本作的名为“manifest.json”的文件。
示例
示例 1
$manifestContent = @'
{
"$schema": "schema.json",
"actions": [
{
"verb": "importBusinessApps",
"listName": "Contoso list",
"solutionRelativeFilePath": "solution.zip"
}
]
}
'@;
Set-Content "manifest.json" $manifestContent
$compress = @{
Path = ".\manifest.json", ".\solution.zip"
DestinationPath = "c:\scripts\site-script-package.zip"
}
Compress-Archive @compress
Add-SPOSiteScriptPackage -Title "Install Contoso flow" -Description "Installs the new Contoso flow in a list" -ContentPath "c:\scripts\site-script-package.zip"
本示例将网站脚本包添加为 zip 文件,其中包含一个manifest.json,其中包含上述脚本作,以及一个具有 Power Automate 流定义的 Dataverse 解决方案 zip 文件。
参数
-ContentPath
包含新网站脚本包内容的 zip 存档文件的绝对路径。
参数属性
| 类型: | System.String |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Description
网站脚本的说明。
参数属性
| 类型: | System.String |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Title
网站脚本的显示名称。
参数属性
| 类型: | System.String |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。