How to get an agent user capability in TFS Build t

2019-06-24 01:38发布

I've declared a user capability named "MyCapability" in a TFS 2015 build agent with a path as value. How can I get this value in the powershell script of my build task ?

$env:MyCapability and $MyCapability don't work.

1条回答
Explosion°爆炸
2楼-- · 2019-06-24 01:46

You cannot access the capabilities from PowerShell through a variable unfortunately.

You could use the Rest Client to connect back to TFS and read the Build Agent as well as the Build Definition to read out the configured values. This will require access to the OAuth token, which can be configured through a checkbox on the Build Definition's configuration page.

查看更多
登录 后发表回答