VMware Cloud Community
maishsk
Expert
Expert

Question about 5.5 - Invoke-VMscript and the release notes

In the Release notes it says

  • Invoke-VMScript
    When using Invoke-VMScript to invoke multi-line BAT and BASH scripts, the command might not run all the script lines.

What exactly does this mean?

Will it run the first 2?

Last 2?

Even lines?

Odd lines?

Just choose which some random lines?

A clarification would be great!!

Maish Saidel-Keesing • @maishsk • http://technodrone.blogspot.com • VMTN Moderator • vExpert • Co-author of VMware vSphere Design
0 Kudos
1 Reply
admin
Immortal
Immortal

Hi Maish,

I apologize for the delayed response.

What this means is that it will either run the whole script or just the first line. We haven't been able to work out exactly what causes this, but we believe it has something to do with the way we escape special symbols and redirect the output in the script before sending it to the guest OS. This is not a new issue for this release, but we decided to add it to the release notes. There are a couple of workarounds for this - 1) make the script single line; 2) save the script in a .bat file, upload it to the guest using Copy-VMGuestFile and execute the file using Invoke-VMScript.

Regards,

Dimitar

0 Kudos