According to [this](http://stackoverflow.com/a/10943885/1085375), you should turn it into `$global:lastexitcode = 0`, otherwise you're creating a local var which hides the actual return code. All specs are OK, except for `running_aspnet_compiler_under_dotNet35_should_pass.ps1`.