How to get an agent user capability in TFS Build task?

杀马特。学长 韩版系。学妹 提交于 2019-12-23 12:36:09

问题


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:


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.



来源:https://stackoverflow.com/questions/39206539/how-to-get-an-agent-user-capability-in-tfs-build-task

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!