2 Replies Latest reply on Jun 28, 2017 3:04 AM by parmarr

    Powershell invokescript not returning data?

    Johnnyw463 Lurker

      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.