Skip to content

Commit

Permalink
Merge pull request #4004 from ricmestre/fix3958
Browse files Browse the repository at this point in the history
IntuneAntivirusPolicyWindows10SettingCatalog: Fix condition in Test-TargetResource to check if resource was removed or not
  • Loading branch information
NikCharlebois authored Dec 6, 2023
2 parents 8bcd5ae + 891b27b commit 58263da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 58263da

Please sign in to comment.