[error]Connecting to remote server <xxx> 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 (TFS 2015 Update 2)
The error is for failing to connect. But the root cause might be more than just WinRM. You will get this error if you did not select proper protocol to connect in your “Run PowerShell on Target Machines”Build/Release steps.
- Run WinRM QuickConfig to config and confirm the running of WinRM
- Check to see if the proper protocol (http or https) is selected
- Verify remote session access from PS Shell Window