Skip to content

Commit 016e46d

Browse files
committed
fix(Chocolatey): 🐛 Correct verbose messages for installed and latest package versions
* Updated verbose output to reflect the actual installed version and the latest version found in the repository. * Changed `PassThru` parameter to `$true` for consistency in command execution.
1 parent ddd9b12 commit 016e46d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

PSDepend/PSDependScripts/Chocolatey.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function Get-ChocoLatestPackage {
120120
$invokeExternalCommandSplat = @{
121121
Command = 'choco.exe'
122122
Arguments = $chocoParams
123-
PassThru = -PassThru
123+
PassThru = $true
124124
}
125125
$convertFromCsvSplat = @{
126126
Header = 'Name', 'Version'
@@ -238,7 +238,7 @@ if ($Force.IsPresent -and $PSDependAction -contains 'Install') {
238238
Write-Verbose "Getting package [$Name] version, if it is installed."
239239
$existingVersion = (Get-ChocoInstalledPackage -Name $Name).Version
240240
if ($existingVersion) {
241-
Write-Verbose "Found package [$Name] installed with version [$Version]."
241+
Write-Verbose "Found package [$Name] installed with version [$existingVersion]."
242242
} else {
243243
Write-Verbose "Package [$Name] not installed."
244244
}
@@ -265,7 +265,7 @@ if ($Credential) {
265265
Write-Verbose "Getting latest package [$Name] version from source [$Source]."
266266
$repositoryVersion = (Get-ChocoLatestPackage @repoParams).Version
267267
if ($repositoryVersion) {
268-
Write-Verbose "Found package [$Name] version [$Version] on source [$Source]."
268+
Write-Verbose "Found package [$Name] version [$repositoryVersion] on source [$Source]."
269269
} else {
270270
Write-Verbose "Package [$Name] not found on source [$Source]. Nothing more can be done."
271271
return # cannot continue

0 commit comments

Comments
 (0)