VMware Cloud Community
zimit
Contributor
Contributor

Invoke a PowerShell Script

Hello,

I have vRO 7.0.1 with lately installed plugin VC 6.5​ (and I think the issue occurred immediately after installing this plugin).

this plugin installed because of upgrading all ESXi and vCenter environment to 6.5.

lately the Built-In workflow named: "Invoke a PowerShell Script" hung for ever when executing a large PS script block.

To debug it, I wrote a smaller script block and the workflow completed successfully.

I ran the same original "big" script block from my PS host, and there were no problems and script completed successfully also.

is it a known issue with the workflow/vRO version/Plugin/PS?

Regards

0 Kudos
5 Replies
daphnissov
Immortal
Immortal

You say you "installed plugin 7.2" but what does that mean?

0 Kudos
zimit
Contributor
Contributor

my mistake, the plugin that were installed is "VC 6.5"

I'll update the original post...

0 Kudos
iiliev
VMware Employee
VMware Employee

Hi,

In fact, there are two plug-ins VC 6.5; the older one that ships with vRO version 7.2, and the newer one that ships with vRO version 7.3. You need to check the plug-in build number to determine which one you have installed.

Both plug-in 6.5 versions are not compatible with vRO 7.0.1, according to VMware product interoperability matrix - https://partnerweb.vmware.com/comp_guide2/sim/interop_matrix.php#interop&117=&2=

0 Kudos
jasnyder
Hot Shot
Hot Shot

I don't see how the two would be linked, given that the PowerShell plugin does not utilize the VC plugin.  It uses WinRM to communicate with a PowerShell host which invokes the scripts remotely via a PowerShell terminal session.  The script you send is in the form of a string piped over that terminal session, so I would maybe guess that something about the script changed coinciding with a VC Plugin change.  Perhaps an invalid string qualifier or something similar made its way into the script.

For debugging purposes, I would start at the console of a Windows machine running a PowerShell terminal.  If you copy and paste the content of the script into the terminal, does it run as expected?  Be sure to log the content of the script before the Invoke a Powershell script workflow is run to verify the script content really is what you think it should be.  Sometimes there are issues with non-escaped characters, etc.  Things like ` and & symbols can cause a lot of havoc.  Sometimes people encode the scripts as base64 and send it to command line (usually not when using the PS plugin).  Perhaps something like that could help in this case.  But I would definitely start with debugging outside of vRO to see if you experience the problem and can pinpoint it there.  Then move back to vRO after that.

0 Kudos
zimit
Contributor
Contributor

Hi guys,

I progressed with my debug and found that there were an update for windows management framework to version 5.

to fix it, I've downloaed and installed PowerShell plugin build 1.0.13.6035468

that solved failures I had.

 

thanks everyone

0 Kudos