Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell 客户端无法连接到请求中指定的目标_Powershell - Fatal编程技术网

Powershell 客户端无法连接到请求中指定的目标

Powershell 客户端无法连接到请求中指定的目标,powershell,Powershell,我正在TC上运行以下脚本(将解析参数) 同一代码在一台机器上工作,而在另一台机器上出现错误。我是PowerShell的新手,您能告诉我以下错误的根本原因是什么,我如何修复它吗 [16:57:12]E: Step 3/15: Deploy - Stop (PowerShell) (2s) [16:57:12]i: [Step 3/15] PowerShell running in non-virtual agent context [16:57:12] : [Step 3/15]

我正在TC上运行以下脚本(将解析参数)

同一代码在一台机器上工作,而在另一台机器上出现错误。我是PowerShell的新手,您能告诉我以下错误的根本原因是什么,我如何修复它吗

[16:57:12]E: Step 3/15: Deploy - Stop (PowerShell) (2s)
[16:57:12]i:     [Step 3/15] PowerShell running in non-virtual agent context
[16:57:12] :     [Step 3/15] PowerShell Executable: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
[16:57:12] :     [Step 3/15] Working directory: D:\apps\TeamCity\BuildAgent\work\d7932d0c55f77e77
[16:57:12] :     [Step 3/15] Command: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
[16:57:12] :     [Step 3/15] PowerShell arguments: -NoProfile, -NonInteractive, -ExecutionPolicy, ByPass, -File, D:\apps\TeamCity\BuildAgent\temp\buildTmp\powershell4985299986600715917.ps1
[16:57:14]E:     [Step 3/15] [host] Connecting to remote server failed with the followi
[16:57:14]E:     [Step 3/15] Error message is logged
[16:57:14]E:     [Step 3/15] ng error message : The client cannot connect to the destination specified in th
[16:57:14]E:     [Step 3/15] e request. Verify that the service on the destination is running and is accepti
[16:57:14]E:     [Step 3/15] ng requests. Consult the logs and documentation for the WS-Management service r
[16:57:14]E:     [Step 3/15] unning on the destination, most commonly IIS or WinRM. If the destination is th
[16:57:14]E:     [Step 3/15] e WinRM service, run the following command on the destination to analyze and co
[16:57:14]E:     [Step 3/15] nfigure the WinRM service: "winrm quickconfig". For more information, see the a
[16:57:14]E:     [Step 3/15] bout_Remote_Troubleshooting Help topic.
[16:57:14]E:     [Step 3/15]     + CategoryInfo          : OpenError: (:) [], PSRemotingTransportException
[16:57:14]E:     [Step 3/15]     + FullyQualifiedErrorId : PSSessionStateBroken
[16:57:14] :     [Step 3/15] Process exited with code 0
winrm quickconfig提供以下内容

C:\Users\apr_ma>winrm quickconfig
WinRM service is already running on this machine.
WinRM is already set up for remote management on this computer.
停下来

echo Stopping App services
wmic service where "name like 'App'" call stopservice
:stopping_services
echo . && timeout 1 > null
wmic service where "name like 'App'" call InterrogateService | find "ReturnValue" | findstr /v "6"
if %errorlevel% == 0 goto stopping_services
echo App services stopped
echo Stopping App services
wmic service where "name like 'App'" call stopservice
:stopping_services
echo . && timeout 1 > null
wmic service where "name like 'App'" call InterrogateService | find "ReturnValue" | findstr /v "6"
if %errorlevel% == 0 goto stopping_services
echo App services stopped