0

我创建了一个 ruby​​ 脚本来打开 Powershell 并运行我在其中创建的模块,以下命令是我用来执行此操作的;

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

在我自己的虚拟机中本地运行它时,它可以正常工作并给我以下输出。虽然当我将它作为库存储在食谱中并通过 Run Deck 运行时,它给了我不同的输出。

本地输出:

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.

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

4

0 回答 0