When executing a Powershell script (in 2.0) using the -File command line switch, and explicitly defining the input parameters in Param, the exit code is always
Hmm that's odd, I'd expect exit 1 to work in both cases. At least you can use this for both:
exit 1
[Environment]::Exit(1)