When executing powershell scripts with "-file", errors are reported as success.
I have this powershell script:
$ErrorActionPreference = "Stop"
ren locked locked2
...which throws exception on the rename command (because the folder is locked by windows - any application might do this, i'm using cmd.exe to provoke an error in this case).
I've currently setup the powershell build step to be executed with "execute .ps1 script with -file argument" instead of "-command -", because -file is preventing another problem - mangling of whitespace in the pipe from stdin.
The script above does throw an exception, but this is reported as a Success by teamcity. This is a bug I suppose? Is there any work-a-round? (without going back to using -command/stdin)