Hello,
I am trying to run a PowerCLI script from vCenter Orchestrator (5.1.0). So far I have configured the Powershell host and I can run simple powershell scripts, but when it comes to use a cmdlet from PowerCLI I always get an error. Here are the different things I have tried:
1. Run the "Invoke an external script" workflow: the external script looks like:
Add-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue
Connect-VIServer XXXX -NotDefault -User XXXXX -Password XXXXX'
Get-VM -Name XXXXX
Disconnect-VIServer XXXX -Confirm:$false
I get an error message saying that Get-VM fails because there are no Servers connected.
2. I used the "Generate an action for a PowerShell cmdlet" (using the Get-VM cmdlet) which runs fine and generates a new workflow, but when I run the workflow I get an error "You are not currently connected to any servers. Please connect first using a Connect cmdlet."
3. Then I followed the documentation and used the converter workflow "Convert PSObject to vCO object", here I specify the vCenter credentials and the following script:
Get-VM -Name XXXXX
I get "'System.OutOfMemoryException' was thrown" error executing Connect-VIServer.
I am kind of lost on what is the correct approach to integrate PowerCLI into vCO. Basically I want to use a PowerCLI script to customize a guest that has been provisioned through vCO.
Any guidance is appreciated.
Juan.