The explanation of the -file option utterly ignores the fact
that it breaks the standard script-parameter interpretation of an array
parameter. That is, if you use:param([string[]]$myparam)
in your script, and invoke it with:powershell -command myscript -myparam foo,bar
then the script receives an array of two parameter values, while if you use:powershell -file myscript -myparam foo,bar
then
the script receives just a single parameter value (the string
"foo,bar", not split into separate
↧