![](/img/trans.png)
[英]Ubuntu Agent - Can't access pipeline variables in powershell task
[英]Powershell can't access runtime environment variables
我想创建一个调用 Powershell 脚本来进行一些处理的任务。 但是我无法从我的 Powershell 脚本中访问 Azure 批处理运行时环境变量。
我可以通过 cmd 访问,下面的命令正确输出
D:\batch\tasks\applications\test12020-05-04-17-32':
cmd /c echo %AZ_BATCH_APP_PACKAGE_Test#1%
但是下面的等效 Powershell 命令显示不正确的 output
%AZ_BATCH_APP_PACKAGE_Test#1%':
powershell -Command echo %AZ_BATCH_APP_PACKAGE_Test#1%
当然,有一种解决方法是创建一个 .bat 脚本来调用 my.ps1 脚本。 但我一直在寻找更好的解决方案。
是否可以从 Powershell 访问 Azure 批处理运行时环境变量?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.