I'm running a Windows 8.1 guest on a Mac OSX 10.11 host, via Vagrant. I want to pass in a script to this guest via command-line. If the guest were Unix-based, I could just do
vagrant ssh -c "$THE_SCRIPT" my-unix-box
It turns out you can pass the script to
vagrant with double-dash separation, like so:
WINDOWS_THINGS="..." vagrant ssh windowsBox -- "$WINDOWS_THINGS"
In my case, this will run the contents of
WINDOWS_THINGS as a
cmd script. I guess the interpreter used depends on the underlying box, but whatever the case this solved my problem. Someone on IRC suggested this to me, and unfortunately I don't remember their name. But, if you're reading this, thank you!