简体   繁体   中英

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. By contrast, when I run the same script on a Windows agent it can get the value correctly.

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.

Thank you

你也可以在linux中运行powershell,我解决了问题,有一些我不知道的事情..在linux机器中,管道变量将字符串转换为大写,所以我只是改为$ env:BUILD.BUILDNUMBER它的工作原理

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM