[英]Ubuntu Agent - Can't access pipeline variables in powershell task
I have created a build with an Ubuntu agent, and I'm trying to access my pipeline variables through a powershell task, but it always returns an empty value. 我已经使用Ubuntu代理创建了一个构建,并且试图通过powershell任务访问管道变量,但是它始终返回一个空值。 By contrast, when I run the same script on a Windows agent it can get the value correctly. 相比之下,当我在Windows代理上运行相同的脚本时,它可以正确获取值。
The script that I use is: 我使用的脚本是:
Write-Host "My Variable is $env:URLAPI"
Write-Host "My Another Variable is $env:Build.BuildNumber"
I just want to know why this works on Windows Agent and not on the Ubuntu Agent. 我只是想知道为什么这适用于Windows Agent而不适用于Ubuntu Agent。
Thank you 谢谢
你也可以在linux中运行powershell,我解决了问题,有一些我不知道的事情..在linux机器中,管道变量将字符串转换为大写,所以我只是改为$ env:BUILD.BUILDNUMBER它的工作原理
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.