Very simple setup, please do try this at home.
test.ps1
$args
test.rb (replace with language of choice, if necessary)
p ARGV
test.bat
@echo off
ruby test.rb "foo bar moo"
powershell .\test.ps1 "foo bar moo"
pause
Run test.bat. Guess the output.
If you think like me, you're wrong.
Output
["foo bar moo"]
foo
bar
moo
Ruby is my witness that the three words are passed as single argument. What in Bill Gates' name is PowerShell doing? And how can I make it work logically?
Or what am I missing?