win_chocolatey: Ensure chocolatey to fail (#26416)

Currently chocolatey is not failing when the user requests version X,
but version X is not available in the repository.

Obviously the module should fail in this case.

This fixes #25393
This commit is contained in:
Dag Wieers 2017-07-05 00:20:20 +02:00 committed by Jordan Borean
parent 8e9d04043a
commit b9d018885a

View file

@ -157,7 +157,7 @@ Function Choco-Upgrade
throw "$package is not installed, you cannot upgrade" throw "$package is not installed, you cannot upgrade"
} }
$cmd = "$executable upgrade -dv -y $package -timeout $timeout" $cmd = "$executable upgrade -dv -y $package -timeout $timeout --failonunfound"
if ($check_mode) if ($check_mode)
{ {
@ -269,7 +269,7 @@ Function Choco-Install
} }
} }
$cmd = "$executable install -dv -y $package -timeout $timeout" $cmd = "$executable install -dv -y $package -timeout $timeout --failonunfound"
if ($check_mode) if ($check_mode)
{ {