Skip to content

Commit

Permalink
(#147) Merge pull request #148 from vector-jnajjar/multipleChocoInsta…
Browse files Browse the repository at this point in the history
…llations

(#147) Fix crashing when PATH contains multiple choco installations
  • Loading branch information
vexx32 authored Sep 25, 2024
2 parents bf77f66 + abb2047 commit 1b323b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion chocolatey/plugins/module_utils/Common.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function Get-ChocolateyCommand {
$IgnoreMissing
)

$command = Get-Command -Name choco.exe -CommandType Application -ErrorAction SilentlyContinue
$command = Get-Command -Name choco.exe -CommandType Application -ErrorAction SilentlyContinue -TotalCount 1

if (-not $command) {
$installDir = if ($env:ChocolateyInstall) {
Expand Down
1 change: 1 addition & 0 deletions chocolatey/plugins/modules/win_chocolatey.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
description:
- Manage packages using Chocolatey.
- If Chocolatey is missing from the system, the module will install it.
- If there are multiple installations of choco.exe in env:PATH, it will use the first found one
requirements:
- chocolatey >= 0.10.5 (will be upgraded if older)
options:
Expand Down

0 comments on commit 1b323b9

Please sign in to comment.