In the Release notes it says
Invoke-VMScriptto 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?
Just choose which some random lines?
A clarification would be great!!
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.