你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

ImageTemplatePowerShellCustomizer interface

在 VM(Windows)上运行指定的 PowerShell。 对应于 Packer powershell 预配程序。 只能指定“scriptUri”或“内联”之一。

扩展

属性

inline

要执行的 PowerShell 命令数组

runAsSystem

如果指定,将使用本地系统用户提升的权限运行 PowerShell 脚本。 仅当上面的 runElevated 字段设置为 true 时,才能为 true。

runElevated

如果指定,将使用提升的权限运行 PowerShell 脚本

scriptUri

要运行用于自定义的 PowerShell 脚本的 URI。 它可以是 github 链接、Azure 存储的 SAS URI 等

sha256Checksum

上述 scriptUri 字段中提供的 power shell 脚本的 SHA256 校验和

type

多态鉴别器,它指定此对象可以的不同类型的

validExitCodes

PowerShell 脚本的有效退出代码。 [默认值: 0]

继承属性

name

用于提供此自定义步骤的上下文的友好名称

属性详细信息

inline

要执行的 PowerShell 命令数组

inline?: string[]

属性值

string[]

runAsSystem

如果指定,将使用本地系统用户提升的权限运行 PowerShell 脚本。 仅当上面的 runElevated 字段设置为 true 时,才能为 true。

runAsSystem?: boolean

属性值

boolean

runElevated

如果指定,将使用提升的权限运行 PowerShell 脚本

runElevated?: boolean

属性值

boolean

scriptUri

要运行用于自定义的 PowerShell 脚本的 URI。 它可以是 github 链接、Azure 存储的 SAS URI 等

scriptUri?: string

属性值

string

sha256Checksum

上述 scriptUri 字段中提供的 power shell 脚本的 SHA256 校验和

sha256Checksum?: string

属性值

string

type

多态鉴别器,它指定此对象可以的不同类型的

type: "PowerShell"

属性值

"PowerShell"

validExitCodes

PowerShell 脚本的有效退出代码。 [默认值: 0]

validExitCodes?: number[]

属性值

number[]

继承属性详细信息

name

用于提供此自定义步骤的上下文的友好名称

name?: string

属性值

string

继承自 ImageTemplateCustomizer.name