我有一个带有 PowerCLI 命令(如 Connect-VIServer 等)的 powershell 脚本文件。在将库引用添加到 VMWare PowerCLI 后,我可以在 PowerGUI 中运行脚本文件,但我不知道如何通过 SoapUI 运行它。我猜它也不适用于常规的 Powershell CLI。有什么办法可以使这项工作?如果有帮助,这是错误:
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