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 {