2016-03-21 70 views
0

我使用PSSession命令通過Powershell從我的桌面連接到服務器。在遠程服務器上安裝了VMware PowerCLI。我試圖運行下面的模塊...

> PS C:\Users\cwip0989\Documents> Enter-PSSession -ComputerName AB-NPC1-D1B099 -Credential cwip0989 
[AB-NPC1-D1B099]: PS C:\Users\cwip0989\Documents> C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noe -c ".\" 
    'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1\'"" 
The remote pipeline has been stopped. 
     + CategoryInfo   : ResourceUnavailable: (:) [], ParentContainsErrorRecordException 
     + FullyQualifiedErrorId : System.Management.Automation.Remoting.PSRemotingDataStructureException 

    [AB-NPC1-D1B099]: PS C:\Users\cwip0989\Documents> C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noe -c ".\" 
    'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1\'"" 
    The remote pipeline has been stopped. 
     + CategoryInfo   : ResourceUnavailable: (:) [], ParentContainsErrorRecordException 
     + FullyQualifiedErrorId : System.Management.Automation.Remoting.PSRemotingDataStructureException 

我相信在PowerShell腳本中有一些限制。是否可以從遠程Powershell會話運行Vmware PowerCLI?

而且我發現一件事情,遠程PowerShell的版本始終是2.1 ...

[AB-NPC1-1B094]: PS C:\> $psversiontable 

Name       Value 
----       ----- 
CLRVersion      2.0.50727.5485 
BuildVersion     6.1.7601.17514 
PSVersion      2.0 
WSManStackVersion    2.0 
PSCompatibleVersions   {1.0, 2.0} 
SerializationVersion   1.1.0.1 
PSRemotingProtocolVersion  2.1 

回答

0

請看看invoke-vmscript 可用於運行在遠程服務器上的命令,但無需做一個靈感。但是,這不會在桌面的PowerShell或Powercli中爲您提供該命令的輸出。

相關問題