Ruby PsExec不返回输出

Ruby PsExec不返回输出,ruby,powershell,psexec,cookbook,rundeck,Ruby,Powershell,Psexec,Cookbook,Rundeck,我已经创建了一个ruby脚本来打开Powershell并运行我在其中创建的模块,下面的命令就是我用来实现这一点的命令 cmd/c c:\\NaviMedix\\Shared\\Bin\\psexec-s c:\\Windows\\System32\\windowsupershell\\v1.0\\powershell.exe c:\\HTTP\\loadServerManager.ps1 在我自己的虚拟机中本地运行时,它工作正常,并提供以下输出。虽然当我把它作为一个库存储在一本烹饪书中并通过ru

我已经创建了一个ruby脚本来打开Powershell并运行我在其中创建的模块,下面的命令就是我用来实现这一点的命令

cmd/c c:\\NaviMedix\\Shared\\Bin\\psexec-s c:\\Windows\\System32\\windowsupershell\\v1.0\\powershell.exe c:\\HTTP\\loadServerManager.ps1

在我自己的虚拟机中本地运行时,它工作正常,并提供以下输出。虽然当我把它作为一个库存储在一本烹饪书中并通过run Deck运行它时,它会给我一个不同的输出

本地输出:

运行甲板输出:


我希望本地输出出现在Run Deck输出中,但似乎无法使其工作。有人能帮我解决这个问题吗?

psexec对输出流做一些奇怪的事情,这是一个很常见的场景。问题是。。。为什么要使用cmd启动启动powershell脚本的psexec进程?为什么不直接启动powershell?我需要使用powershell 32位,如果我尝试直接打开powershell,它将提供我无法在其上运行模块的64位powershell。直接启动32位版本。您当前的脚本仍然调用64位脚本。32位位于:C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe抱歉,我的意思是另一种情况,我需要使用64位powershell,如果我尝试直接打开powershell,它将为我提供32位。即使直接调用它,它仍会显示错误的Powershell:/
PsExec v1.86 - Execute processes remotely
Copyright (C) 2001-2007 Mark Russinovich
Sysinternals - www.sysinternals.com

Starting C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe on SCSBCHEFTE


C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe exited on SCSBCHEFTEST04 with error code 0.

Welcome to Powershell augmented with NaviNet tools.


Directory: C:\Windows\system32\WindowsPowerShell\v1.0\Modules


ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Manifest   2.0.0.0    AppLocker                           {Get-   AppLockerFile...
Manifest   2.0.0.0    Appx                                {Add-AppxPackage, ...
Manifest   1.0        BestPractices                       {Get-BpaModel, 

Success       : True
RestartNeeded : No
FeatureResult : {}
ExitCode      : NoChangeNeeded


Name                      : NET-HTTP-Activation
DisplayName               : HTTP Activation
Description               : HTTP Activation supports process activation via
                        HTTP. Applications that use HTTP Activation can
                        start and stop dynamically in response to work
                        items that arrive over the network via HTTP.
Installed                 : True
InstallState              : Installed
PsExec v1.86 - Execute processes remotely
Copyright (C) 2001-2007 Mark Russinovich
Sysinternals - www.sysinternals.com

Connecting to local system...
Starting PsExec service on local system...
Connecting with PsExec service on SCSBCHEFTEST01...
Starting C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe on SCSBCHEFTEST01...
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe exited on SCSBCHEFTEST01 with error code 1.