TIL, (I am powershell naive, so maybe obvious to most of you):
If you run powershell -command my-command the exit code from my-command is not returned to the caller.
For that you need tag on an exit $LASTEXITCODE , like:
powershell -command "my-command;exit $LASTEXITCODE"
Kind of important if you are wanting to know about little things like test failures.