目标机上的PowerShell在TFS2018发布管道中出现故障

问题描述 投票:0回答:1

我是TFS2018的新手,我正在尝试配置CICD管道。我的构建成功,在我的发布管道中,我需要在我的部署服务器上运行powershell脚本,所以我使用RUN PowerShell on Target Machine任务。我想,正确地提供了所有所需的信息,并运行了发布,但在这个任务中得到了错误,如下所示。

Connecting to remote server xxx.xxx.xx.xx failed with the following error message : The WinRM client cannot process the request. Default authentication may be used with an IP address under the following conditions: the transport is HTTPS or the destination is in the TrustedHosts list, and explicit credentials are provided. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. For more information on how to set TrustedHosts run the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic.

请看下面我的任务配置

enter image description here

enter image description here

我试着把我的TFS2018服务器添加为目标服务器上的trustedHost,但问题依然存在。请提出建议和帮助。

powershell tfs azure-pipelines-release-pipeline release-management ms-release-management
1个回答
0
投票
  1. 通过powershell将TFS服务器机器添加到目标机器的TrustedHost中。Set-Item WSMan:localhost\client\trustedhosts -value ServerDC

  2. 确保在此任务中提供的凭证是管理员角色,同时他们有访问TFS的权限。如果所提供的凭证没有TFS管理权限,任务将无法调用代理来触发 VisualStudioRemoteDeployer.


0
投票

这就是PowerShell的双跳问题,通常意味着你试图用不同的证书登录到远程机器,而不是你的用户正在运行的证书。 那么在你的情况下,$(adminUserName)是否与代理相同?如果不是,那么你可以尝试将该用户改为与代理相同的用户。 如果不是,那么你需要做得更多一些,然后将机器添加到 trustedHost。 请看SPN上的这个视频,可能会有帮助 https:/www.youtube.comwatch?v=yFgdPcLOs-g 这里是关于双跳问题的详细解释。https:/docs.microsoft.comen-uspowershellscriptinglearnremotingps-remoting-second-hop?view=powershell-7。

© www.soinside.com 2019 - 2024. All rights reserved.