tfs 2015 (vNext) 构建任务:无法 运行 远程机器上的 powershell 脚本 (win 7)

tfs 2015 (vNext) build task: unable to Run powershell script on remote machine ( win 7)

这是简单的 tfs powershell 构建任务,我无法让它工作,试图 运行 windows 7 机器上的脚本。

我收到以下错误:

2017-11-11T21:46:00.4972350Z ##[error]Connecting to remote server ryhel-d8x7frd failed with the following error message : The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". For more information, see the about_Remote_Troubleshooting Help topic. For more info please refer to http://aka.ms/powershellontargetmachinesreadme

我提到了 ,但我不知道如何克服构建任务中的这个错误。任何帮助,将不胜感激 ?谢谢。

PowerShell on Target Machines 任务使用 Windows 远程管理 (WinRM) 访问本地物理计算机或虚拟计算机。

根据错误信息,一般WinRM/Remote Powershell 服务配置不正确会导致该问题。因此,只需尝试重新配置服务即可。

你可以先用命令Test-WsMan COMPUTER测试连接目标机器,如果服务建立任务当然会连接到远程服务器失败不可用。

按照本文的步骤配置WinRM:WinRM configuration

还要确保 WinRM 服务已启动:Enable-PSRemoting -Force