Powershell exit code is failing build

dhickey's Avatar


10 Jan, 2015 09:49 PM

I'm executing my build via a powershell script: .\hello.ps1; exit $LASTEXITCODE

The script is super-simple and nothing goes wrong https://github.com/damianh/AppVeyorPowershellExitCode/blob/master/h...

Why does AppVeyor think my build has failed? https://ci.appveyor.com/project/damianh/appveyorpowershellexitcode


  1. Support Staff 1 Posted by Feodor Fitsner on 10 Jan, 2015 09:54 PM

    Feodor Fitsner's Avatar

    Will take a look.

    What's your goal by using exit $LASTEXITCODE?

  2. 2 Posted by cameron.taggart on 05 May, 2015 11:35 PM

    cameron.taggart's Avatar

    I was surprised that doing an exit 0 failed the build. It was easy enough to work around with:

    if ($lastexitcode -ne 0){ exit $lastexitcode }
  3. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:56 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac