From 548cd0c9638a20a57c7184f801d716a6ed6ccfe9 Mon Sep 17 00:00:00 2001 From: jrdnr Date: Fri, 22 Mar 2019 08:25:35 -0400 Subject: [PATCH] Corrected reversed logic in `if (-not $Purge) Using `$Purge.IsPresent` to be more explicit. --- DSCResources/cChocoPackageInstall/cChocoPackageInstall.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DSCResources/cChocoPackageInstall/cChocoPackageInstall.psm1 b/DSCResources/cChocoPackageInstall/cChocoPackageInstall.psm1 index 11a425e..5221c08 100644 --- a/DSCResources/cChocoPackageInstall/cChocoPackageInstall.psm1 +++ b/DSCResources/cChocoPackageInstall/cChocoPackageInstall.psm1 @@ -433,7 +433,7 @@ function Get-ChocoInstalledPackage { } $ChocoInstallList = Join-Path -Path $ChocoInstallLP -ChildPath 'ChocoInstalled.xml' - if ($Purge) { + if ($Purge.IsPresent) { Remove-Item $ChocoInstallList -Force $res = $true } else { @@ -464,7 +464,7 @@ function Get-ChocoVersion { } $chocoVersion = Join-Path -Path $chocoInstallCache -ChildPath 'ChocoVersion.xml' - if ( -not $Purge) { + if ($Purge.IsPresent) { Remove-Item $chocoVersion -Force $res = $true } else {