VMware Cloud Community
Johnnyw463
Contributor
Contributor

Powershell invokescript not returning data?

Hey Guys,

I am currently running some external powershell through vRO against our powershell server.

I have tried this in the following environments:

  • vRO 7.2 - PS Plugin v1.0.11
  • vRO 7.2 - PS Plugin v1.0.9
  • vRO 7.1 - PS Plugin v1.0.9

The powershell is returning a PSObject, and it is being parsed via:

myvar.getResults().getRootObject().getProperty('InstanceId');

I know for a fact that the object is getting returned correctly because when I execute

myvar.getHostOutput();

My supposedly 'returned' object is being displayed to the console on the remote powershell server. I also have some logging setup on the powershell server that confirms this as well.

I believe it has something to do with a timeout of some kind within the powershell plugin. If I run my powershell cmdlet in 'test' mode, the script runs for 30 seconds and the data comes back just fine. However, when I am actually trying to run the cmdlet, it takes about 15 minutes, and I am unable to parse the response. I am getting the following error back:

TypeError: Cannot find function getProperty in object ,Windows IP Configuration,,Successfully flushed the DNS Resolver Cache.,DynamicWrapper (Instance) : [PowerShellPSObject]-[class com.vmware.o11n.plugin.powershell.model.result.PSObject

This error would indicate that the object that was returned wasn't actually a PSObject. But this is false, the HostOutput says otherwise, as well as the logging setup on the PS server.

Anybody else experience anything like this?

EDIT:

I have also attempted to just return a string instead of a PSObject, the result is the same. When the workflow runs quickly, it works. When it runs in full, nothing comes back.

0 Kudos
2 Replies
igaydajiev
VMware Employee
VMware Employee

It might be that returned result is actually an array.

Could you log myvar.getResults().getXml() and post it here.

This is the row output from executed script

0 Kudos
parmarr
VMware Employee
VMware Employee

Hello, You could refer to the thread vRO Powershell plugin not returning results anymore?

Sincerely, Rahul Parmar VMware Support Moderator
0 Kudos