使用现场 TFS2015 提供的 PowerShell 脚本配置构建代理时,脚本出错,因为它在服务器上找不到代理池。
但是,代理池“默认”肯定存在。在另一台服务器上,相同的脚本按预期工作,并运行构建。请参阅下面的脚本输出。
我试图遵循:
是什么导致脚本在代理池验证时失败?
PS C:\Windows\system32> E:\Build\agentConfigureAgent.ps1
Enter the name for this agent (default is Agent-SRV001): BUILD002
Enter the URL for the Team Foundation Server (default is: http://[ip-address]:8080/tfs
Configure this agent against which agent pool? (default pool name is 'default'):
Enter the path of work folder for this agent (default is 'E:\Build\agent_work'): E:\Build\Work
Would you like to install the agent as a Windows Service (Y/N) (default is Y): n
Would you like to unconfigure any existing agent (Y/N) (default is N; the agent will be updated):
Configuring agent
Unblocking files Calling agent configure without /RunningAsService
Calling agent configure without /Force
Unable to find a agent pool with the name: default
WARNING: Configure agent failed, but you might fix this problem by configure with /Force.
Would you like to try agent configure again with parameter -Force (Y/N): y
Calling agent configure without /RunningAsService
Calling agent configure with /Force
Unable to find a agent pool with the name: default
E:\Build\agent\ConfigureAgent.ps1 : Configure agent failed. At line:1 char:1
+ E:\Build\agent\ConfigureAgent.ps1 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,ConfigureAgent.ps1
最佳答案
运行构建过程脚本的用户帐户需要是 Agent Pool Administrator Accounts
的一部分.
脚本中的错误消息具有误导性。
关于tfs - 由于未找到代理池,配置 TFS2015 构建代理失败。为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30841277/