appveyor / ci

AppVeyor community support repository
https://www.appveyor.com
344 stars 66 forks source link

PowerShell Core on Windows jobs fail with exceptions, but builds pass #2498

Open tlindsay42 opened 6 years ago

tlindsay42 commented 6 years ago

PowerShell Core on Windows jobs fail with exceptions, but builds pass

Examples

OwenMcDonnell commented 6 years ago

Could it be that $ErrorActionPreference is temporarily being set to 'Continue' here?

tlindsay42 commented 6 years ago

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 image

FeodorFitsner commented 6 years ago

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.

OwenMcDonnell commented 6 years ago

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.