How to get agent user ability in a TFS Build task?

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

$env:MyCapabilityand $MyCapabilitydo not work.

+4
source share
1 answer

Unfortunately, you cannot access PowerShell features through a variable.

You can use the Rest Client to connect to TFS and read the assembly agent, as well as the "Assembly Definition" , to read the configured values. This will require access to the OAuth token, which can be configured using the checkbox on the build definition configuration page.

+3
source

Source: https://habr.com/ru/post/1652851/


All Articles