win_chocolatey Fix incompatibilities with latest Chocolcatey release

This commit is contained in:
Jordan Borean 2019-03-15 16:48:18 +10:00 committed by Matt Clay
parent 995a7e6453
commit 7ee89d4ac6
2 changed files with 4 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- win_chocolatey - Fix incompatibilities with the latest release of Chocolatey ``v0.10.12+``

View file

@ -155,7 +155,8 @@ Function Choco-IsInstalled
Fail-Json -obj $result -message "Error checking installation status for package 'package': $($_.Exception.Message)"
}
if ($LastExitCode -ne 0) {
# Chocolatey v0.10.12 introduced enhanced exit codes, 2 means no results, e.g. no package
if ($LastExitCode -notin @(0, 2)) {
$result.rc = $LastExitCode
$result.command = "$script:executable list $options"
$result.stdout = $output | Out-String