Hello,
Can anybody help me with an issue?
I'm trying to get some information about VMware View environment by using View PowerCLI cmdlets in Orchestrator via PowerShell session (using official VMware Powershell plugin).
Command invocation works fine, but I have problems in processing results:
If I use getHostOutput() method on result object, I receive text representation of the information produced by corresponding command.
However, when I try to get Object representation of same info (using sample workflows as example and using powershell plugin guide) then it doesn't work. More specifically:
var cmdResult = viewConnectionServer.invokeScript("Add-PSSnapin VMware.View.Broker; Get-Pool");
var objList;
var strOutput = cmdResult.getHostOutput(); // This returns textual output - same as if executed from PowerCLI console.
var rootObject = cmdResult.getResults().getRootObject();
if (rootObject instanceof Array) objList = rootObject;
else objList = [rootObject];
var poolId = objList[0].getProperty('pool_id'); // This returns null !!!
So any property I try to get from any PSObject in the array just returns "null" value. The object itself is serialized properly - if I check getResults().getXml() then all properties are there. And if I try the same approach with "dir" command - the properties are extracted properly.
What am I doing wrong?