Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用Azure自动化帐户';加密变量';在PowerShell运行手册中?_Azure_Azure Powershell_Azure Automation_Azure Runbook - Fatal编程技术网

如何使用Azure自动化帐户';加密变量';在PowerShell运行手册中?

如何使用Azure自动化帐户';加密变量';在PowerShell运行手册中?,azure,azure-powershell,azure-automation,azure-runbook,Azure,Azure Powershell,Azure Automation,Azure Runbook,如果我使用Get AzAutomationVariable-Name EncryptedVar,那么变量的值在输出中显示为null,我无法使用它 我使用了Get AutomationVariable-Name EncryptedVar。它工作正常,但它以纯文本形式公开变量的值 有没有办法在第一个脚本(Get AzAutomationVariable)的帮助下使用加密变量?首先,准确回答您的直接问题: 有没有办法在第一个脚本(Get-AzAutomationVariable)的帮助下使用加密变量

如果我使用
Get AzAutomationVariable-Name EncryptedVar
,那么变量的值在输出中显示为null,我无法使用它

我使用了
Get AutomationVariable-Name EncryptedVar
。它工作正常,但它以纯文本形式公开变量的值


有没有办法在第一个脚本(Get AzAutomationVariable)的帮助下使用加密变量?

首先,准确回答您的直接问题:

有没有办法在第一个脚本(Get-AzAutomationVariable)的帮助下使用加密变量

根据设计,
Get-AzAutomationVariable
不会检索机密。它不会以任何形式返回加密的变量值

不过,你的担忧和目标并不完全清楚。如果
Get-AzAutomationVariable
返回了变量值,那么您不会与
Get-AutomationVariable
有完全相同的问题吗?您打算如何准确地使用此变量的值?你打算把秘密传给任何外部系统吗?这个外部系统以什么形式接受这个秘密


请注意,
Get AutomationVariable
本身并不公开该值:作为runbook作者,您可以自由地对其进行任何操作。显然,如果将其打印到日志中,它将向所有日志读取器公开。但是,如果你不这样做,它就不会暴露。例如,您可以立即将其包装为
SecureString
。最终,这取决于runbook代码所有者。

你的意思是什么
使用加密变量而不公开值?@jimXu不要紧,我已经更正了声明是的Anatoli,你是正确的。谢谢你的澄清。