0
votes

Here is the simple tfs powershell build task, i couldn't make it work, trying to run the script on windows 7 machine.

TFS build task

i am getting the below error:

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

i referred the Same question & answer , but i have no clue how to overcome this error from build task. any help would be appreciated ? Thanks.

1
What troubleshooting steps have you taken? What have you tried that hasn't worked? This is a very broad problem with many possible causes and it's useful to know what you've already tried that hasn't worked.Daniel Mann
Hi, I tried the powershell instructions in the end i can not connect to remote computer, Test-WsMan COMPUTER . also upgraded the ps version to 4. still no use.chandu

1 Answers

0
votes

PowerShell on Target Machines task uses Windows Remote Management (WinRM) to access on-premises physical computers or virtual computers.

Based on the error message, generally WinRM/Remote Powershell service isn't configured correctly will cause that issue. So just try to reconfigure the service.

You can Test the Connection with the command Test-WsMan COMPUTER first for the target machine, build task of course will be failed to connect to the remote server if the service is not avaiable.

Following the step in this article to configure the WinRM: WinRM configuration

Also make sure WinRM service is started : Enable-PSRemoting -Force