TFS 2018 Create agent pool programatically

前端 未结 2 1258
栀梦
栀梦 2021-01-17 04:00

Is it possible to create an Agent Pool in TFS 2018 programatically, preferably via PowerShell? I cannot find anything like that in REST API.

2条回答
  •  耶瑟儿~
    2021-01-17 04:03

    The REST API of TFS has an undocumented portion that deals with app pools: _apis/distributedtask/pools. For example:

    Get agent pools (Request method: Get):

    http://[TFS URL]/_apis/distributedtask/pools?api-version=x.x-preview.1`
    

    api-version should match your TFS version

    You could open up Chrome/IE Network inspector and found that the API calls for create agent pool action. How to do this please refer:

    • Analyzing your webpage's network traffic
    • Using Windows Internet Explorer Developer Tools Network Capture

    Finally, you just need to call REST API through PowerShell, take a look at this answer.

提交回复
热议问题