我有PowerCLI命令像Connect-VIServer等PowerShell脚本文件我能够在PowerGUI中运行脚本文件后,我添加到VMWare PowerCLI库引用,但我不知道如何通过SoapUI运行它。我猜测它不适用于常规的Powershell CLI。有什么办法可以做到这一点?这里的错误,如果它可以帮助:使用SoapUI运行VMWare powerCLI命令
The term 'Connect-VIServer' is not recognized as the name of a cmdlet, function
, script file, or operable program. Check the spelling of the name, or if a pat
h was included, verify that the path is correct and try again.
At Test.ps1:10 char:23
+ $vm = Connect-VIServer <<<< -Server $vcenterIP -User $vcenterUser -Password
$vcenterPW
+ CategoryInfo : ObjectNotFound: (Connect-VIServer:String) [], Co
mmandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
我知道我能做到这一点,如果从正常的Windows命令提示符下,我可以运行该脚本。在我的SoapUI的Groovy脚本中,我执行这个命令“powershell Test.ps1”。如果我使用诸如“powercli Test.ps1”之类的东西,它可能对我有用。不幸的是,这是行不通的。有没有这样的魔法命令? – dhishkaow 2012-07-19 19:21:38