Set-AzAutomationVariable
语法
UpdateVariableValue
Set-AzAutomationVariable
[-Name] <String>
[-ResourceGroupName] <String>
[-AutomationAccountName] <String>
-Encrypted <Boolean>
-Value <Object>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
UpdateVariableDescription
Set-AzAutomationVariable
[-Name] <String>
[-ResourceGroupName] <String>
[-AutomationAccountName] <String>
-Description <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
Set-AzAutomationVariable cmdlet 修改Azure 自动化中变量的值或说明。
若要加密变量,请指定 Encrypted 参数。
创建后无法修改变量的加密状态。
为 现有非加密变量指定 Encrypted 失败。
示例
示例 1:设置变量的值
Set-AzAutomationVariable -AutomationAccountName "Contoso17" -Name "StringVariable22" -ResourceGroupName "ResourceGroup01" -Value "New Value" -Encrypted $False
此命令在名为 Contoso17 的 Azure 自动化 帐户中为名为 StringVariable22 的变量设置一个新值。
参数
-AutomationAccountName
指定存储变量的自动化帐户的名称。
参数属性
类型: | String
|
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
(All)
Position: | 1 |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
-DefaultProfile
用于与 azure 通信的凭据、帐户、租户和订阅
参数属性
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-Description
指定变量的说明。
参数属性
类型: | String
|
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
UpdateVariableDescription
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
-Encrypted
指定 cmdlet 是否加密存储变量的值。
参数属性
类型: | Boolean
|
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
UpdateVariableValue
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
-Name
指定此 cmdlet 修改的变量的名称。
参数属性
类型: | String
|
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
(All)
Position: | 2 |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
-ResourceGroupName
指定此 cmdlet 修改变量的资源组。
参数属性
类型: | String
|
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
(All)
Position: | 0 |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
-Value
指定变量的值。
参数属性
类型: | Object
|
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
UpdateVariableValue
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。
输出