ScriptApplication [SPFSDK][VMROLE]
适用于:Windows Azure Pack
ScriptApplication 对象是一个脚本 [SPFSDK][VMROLE] 对象,该对象具有在预配基于Windows的虚拟机时要执行的子脚本列表。
类型层次结构
ResourceExtension [SPFSDK][VMROLE].ExtensionSettings [SPFSDK][VMROLE].ApplicationProfile.WindowsApplicationProfile [SPFSDK][VMROLE].ScriptApplication
语法
{
"DeploymentName": "string",
"ScriptCommands": [
<Script>
],
"EnvironmentVariables": [
<EnvironmentVariable>
],
<All Script properties except DeploymentOrder, ScriptType, and RestartOnRetry>
}
属性
ScriptApplication 对象具有脚本 [SPFSDK][VMROLE] 类型的所有属性,但以下属性除外:
DeploymentOrder
ScriptType
RestartOnRetry
重新运行父扩展引用应用程序时 ,ScriptApplication 对象始终重新启动。
名称 |
类型 |
必须 |
默认值 |
说明 |
---|---|---|---|---|
DeploymentName |
字符串 |
是 |
无 |
部署的名称。 |
ScriptCommands |
否 |
Null |
预配期间要运行的脚本。 |
|
EnvironmentVariables |
EnvironmentVariable 数组 |
否 |
Null |
要针对 ScriptCommands 属性标识的脚本设置的环境变量。 |
EnvironmentVariable
名称 |
类型 |
必须 |
默认值 |
说明 |
---|---|---|---|---|
名称 |
String |
是 |
无 |
要设置的环境变量的名称。 |
“值” |
字符串 |
是 |
无 |
环境变量的值。 |
备注
下面的代码示例提供了一个包含一个子脚本的示例 ScriptApplication 对象。
{
"DeploymentName": "ScriptDeployment1",
"ScriptCommands": [
{
"AlwaysReboot": false,
"ApplicationPayloadId": "366819c2-bf11-4c85-9555- 6293e2a3ce7b",
"ErrorPolicy": "FailOnMatch",
"ExecutableAndParams": {
"Executable": "cmd.exe",
"Parameters": "/q /c installwebdeploy.cmd"
},
"ExitCodeRegex": "[1-9][0-9]*",
"MaxOutputSize": 1048576,
"RebootExitCodeRegex": "{1641}|{3010}|{3011}",
"RestartOnRetry": false,
"ScriptBlock": null,
"ScriptCredential": "domain\\user:mypassword",
"ScriptType": "PreInstall",
"StandardErrorPath": "c:\err.txt",
"StandardErrorRegex": ".+",
"StandardInput": null,
"StandardOutputPath": "c:\out.txt",
"StandardOutputRegex": null,
"TimeoutInSeconds": 900,
"WorkingDirectory": null
}
],
"EnvironmentVariables": [
{
"Name": "envvar1",
"Value": "test value1",
},
{
"Name": "envvar2",
"Value": "test value2",
},
],
"AlwaysReboot": false,
"ApplicationPayloadId": "49c1ccdb-9068-4b91-9409-0a7ca8a1d291",
"ErrorPolicy": "FailOnMatch",
"ExecutableAndParams": {
"Executable": "cmd.exe",
"Parameters": "/q /c msiexec sharepoint.msi"
},
"ExitCodeRegex": "[1-9][0-9]*",
"MaxOutputSize": 1048576,
"RebootExitCodeRegex": "{1641}|{3010}|{3011}",
"ScriptBlock": null,
"ScriptCredential": "username:password",
"StandardErrorPath": "c:\err.txt",
"StandardErrorRegex": ".+",
"StandardInput": null,
"StandardOutputPath": "c:\out.txt",
"StandardOutputRegex": null,
"TimeoutInSeconds": 900,
"WorkingDirectory": null
}
另请参阅
ApplicationProfile.WindowsApplicationProfile [SPFSDK][VMROLE]
SQLProfile [SPFSDK][VMROLE]
WebDeployApplication [SPFSDK][VMROLE]
SQLDacApplication [SPFSDK][VMROLE]
脚本 [SPFSDK][VMROLE]