diff --git a/DSCResources/cChocoPackageInstall/cChocoPackageInstall.psm1 b/DSCResources/cChocoPackageInstall/cChocoPackageInstall.psm1 index 156de19..5caaa51 100644 --- a/DSCResources/cChocoPackageInstall/cChocoPackageInstall.psm1 +++ b/DSCResources/cChocoPackageInstall/cChocoPackageInstall.psm1 @@ -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 }