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
(cherry picked from commit b9d018885a21ee773cd636bf5dcbb51cb564dffe)
... | ... |
@@ -156,7 +156,7 @@ Function Choco-Upgrade |
156 | 156 |
throw "$package is not installed, you cannot upgrade" |
157 | 157 |
} |
158 | 158 |
|
159 |
- $cmd = "$executable upgrade -dv -y $package -timeout $timeout" |
|
159 |
+ $cmd = "$executable upgrade -dv -y $package -timeout $timeout --failonunfound" |
|
160 | 160 |
|
161 | 161 |
if ($check_mode) |
162 | 162 |
{ |
... | ... |
@@ -268,7 +268,7 @@ Function Choco-Install |
268 | 268 |
} |
269 | 269 |
} |
270 | 270 |
|
271 |
- $cmd = "$executable install -dv -y $package -timeout $timeout" |
|
271 |
+ $cmd = "$executable install -dv -y $package -timeout $timeout --failonunfound" |
|
272 | 272 |
|
273 | 273 |
if ($check_mode) |
274 | 274 |
{ |