diff --git a/CHANGELOG.md b/CHANGELOG.md index a6537e7c81..06fede35d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ # UNRELEASED +* IntuneAntivirusPolicyWindows10SettingCatalog + * Fix condition in Test-TargetResource to check if resource was removed or not + FIXES [#3958](https://github.com/microsoft/Microsoft365DSC/issues/3958) * IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10 * Fix typo in assignment cmdlet FIXES [#3996](https://github.com/microsoft/Microsoft365DSC/issues/3996) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneAntivirusPolicyWindows10SettingCatalog/MSFT_IntuneAntivirusPolicyWindows10SettingCatalog.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneAntivirusPolicyWindows10SettingCatalog/MSFT_IntuneAntivirusPolicyWindows10SettingCatalog.psm1 index 76d31bcbf7..4e12202bf3 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneAntivirusPolicyWindows10SettingCatalog/MSFT_IntuneAntivirusPolicyWindows10SettingCatalog.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneAntivirusPolicyWindows10SettingCatalog/MSFT_IntuneAntivirusPolicyWindows10SettingCatalog.psm1 @@ -1286,9 +1286,9 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { - Write-Verbose -Message 'The policy was not found' + Write-Verbose -Message "Test-TargetResource returned $false" return $false } $testResult = $true