Skip to content

Commit

Permalink
[chocolatey#135] A fix for passing custom source name in cChocoPackag…
Browse files Browse the repository at this point in the history
…eInstaller Test-TargetResource
  • Loading branch information
bozho committed Jan 3, 2020
1 parent aed5976 commit 5b3ceef
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions DSCResources/cChocoPackageInstall/cChocoPackageInstall.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,13 @@ function Test-TargetResource
Write-Verbose -Message "Checking if $Name is installed"

if ($AutoUpgrade -and $isInstalled) {
$testParams = @{
pName = $Name
}
if ($Source){
[string]$pSource = "-pSource `"$Source`""
$testParams.pSource = $Source
}
$result = Test-LatestVersionInstalled -pName $Name $pSource
$result = Test-LatestVersionInstalled @testParams
} else {
$result = $isInstalled
}
Expand Down

0 comments on commit 5b3ceef

Please sign in to comment.