diff --git a/lib/ansible/modules/windows/win_chocolatey.ps1 b/lib/ansible/modules/windows/win_chocolatey.ps1 index 236a6c95f11..9ada67b5f13 100644 --- a/lib/ansible/modules/windows/win_chocolatey.ps1 +++ b/lib/ansible/modules/windows/win_chocolatey.ps1 @@ -157,7 +157,7 @@ Function Choco-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) { @@ -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) {