簡體   English   中英

TFS 2017-從TFS服務器而非代理運行Powershell腳本

[英]TFS 2017 - Run powershell script from TFS server, not agent

在發布期間,是否可以從實際的TFS服務器運行Powershell腳本? 我正在docker容器中運行構建代理,並且未加入域,因此wmi不允許docker容器中的Windows代理在復制新的工件文件之前停止Web服務器上的應用程序池,即使我指定了憑據在連接之前。 如果我可以從TFS 2017服務器運行powershell腳本,則將解決此問題。

我得到的錯誤是:

019-08-30T13:49:44.6542238Z ##[error][<server>.<domain>.com] Connecting to remote server <server>.<domain>.com failed with the following error message : The WinRM client cannot process the request. If the authentication scheme is different from Kerberos, or if the client computer is not joined to a domain, then HTTPS transport must be used or the destination machine must be added to the TrustedHosts configuration setting. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. You can get more information about that by running the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic. + CategoryInfo : OpenError: (<server>.<domain>.com:String) [], PSRemotingTransportException + FullyQualifiedErrorId : ServerNotTrusted,PSSessionStateBroken

我一直無視docker windows servercore tfs代理容器,以為它必須與我要復制文件的服務器有關,但事實並非如此。 由於某種原因,我要做的就是將以下內容添加到我的tfs代理中:

winrm設置winrm / config / client @ {TrustedHosts =“ machineA,machineB”}

現在一切正常。 我從wsam中刪除了所有可信任的主機,但仍然可以使用。 我猜是因為我在Powershell腳本中使用憑據...不確定,但我很高興。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM