Chocolatey v0.10.3 Release Notes
Release Date: 2016-10-07 // over 7 years ago-
💥 BREAKING CHANGES
- Fix - Do Not Check
$LastExitCode
- Only error a package install if script errors or set a different exit code when it is specifically set - see #1000
Starting in v0.9.10, Chocolatey started checking
$LASTEXITCODE
in addition to the script command success as a way to be more helpful in determining package failures. This meant it offered the ability to capture when a script exited withExit 1
and handle that accordingly. However that really has never been a recommended scenario for returning errors from scripts and is not seen in the wild anywhere so it is believed that those that may be affected are very few.Checking
$LastExitCode
checks the last executable's exit code when the script specifically does not callExit
(which is . This can lead to very perplexing failures, such as running a successful xcopy that exits with2
and seeing package failures without understanding why. Since it is not typically recommended to callExit
to return a value from PowerShell because of issues with different hosts, it's less of a concern to only look at explicit failures. For folks that may need it, allow failing a package again by the last external command exit code orexit
from a PowerShell script. Note that it is not recommended to use exit with a number to return from PowerShell scripts. Instead you should use$env:ChocolateyExitCode
orSet-PowerShellExitCode
(first available in v0.9.10) to ensure proper setting of the exit code.If you need the prior behavior, please turn on the feature
scriptsCheckLastExitCode
.🐛 BUG FIXES
- Fix - Do Not Check