Open tlindsay42 opened 6 years ago
Could it be that $ErrorActionPreference is temporarily being set to 'Continue' here?
Good call 🤦♂️. This was a bad example because I had to do that as a workaround since mkdocs sends all output to stderr. Here is a better example:
https://ci.appveyor.com/project/tlindsay42/armorpowershell/build/1.0.291/job/lhrti66cglq7fjmu
Here I'm trying to reproduce the issue by calling non-existent cmdlet inside the script (appveyor.yml): https://ci.appveyor.com/project/appveyor-tests/ps-core-should-fail - it fails as expected.
My guess there is something deeper in your script suppressing the error/exit.
I'm curious if removing the -force
flag from Invoke-PSDeploy
call here could make the error propagate properly?
Otherwise, I'm thinking maybe putting the cmdlet in a try-catch block could correct this.
PowerShell Core on Windows jobs fail with exceptions, but builds pass
Examples