From 5b3ceeff0561c871067bbe4bf09f47b6d822ff81 Mon Sep 17 00:00:00 2001 From: Marko Bozikovic Date: Fri, 3 Jan 2020 16:29:10 +0100 Subject: [PATCH] [#135] A fix for passing custom source name in cChocoPackageInstaller Test-TargetResource --- .../cChocoPackageInstall/cChocoPackageInstall.psm1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 }