Skip to content

Commit

Permalink
Merge pull request #5262 from ricmestre/fixexotenantallowblocklistitems
Browse files Browse the repository at this point in the history
EXOTenantAllowBlockListItems: Fix Test-TargetResource
  • Loading branch information
NikCharlebois authored Oct 24, 2024
2 parents 10c5cda + c93afb8 commit 720224b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
* Fixed missing permissions in settings.json
* EXOMailboxAuditBypassAssociation
* Initial release.
* EXOTenantAllowBlockListItems
* Fixed `Test-TargetResource` to correctly mark when this resource is removed
* IntuneDerivedCredential
* Fixed export and deployment when `NotificationType` had more than one option
selected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,18 +378,21 @@ function Test-TargetResource

$CurrentValues = Get-TargetResource @PSBoundParameters
$ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone()
$ValuesToCheck.Remove('Entries') | Out-Null
if ($null -ne $ValuesToCheck.ExpirationDate -and $ValuesToCheck.ExpirationDate.Kind -eq 'Local')
{
$ValuesToCheck.ExpirationDate = $ValuesToCheck.ExpirationDate.ToUniversalTime().ToString()
}

if ($CurrentValues.Ensure -eq 'Absent')
if ($CurrentValues.Ensure -ne $Ensure)
{
Write-Verbose -Message "Test-TargetResource returned $false"
return $false
}

if ($null -ne $ValuesToCheck.ExpirationDate -and $ValuesToCheck.ExpirationDate.Kind -eq 'Local')
{
$ValuesToCheck.ExpirationDate = $ValuesToCheck.ExpirationDate.ToUniversalTime().ToString()
}

$ValuesToCheck = Remove-M365DSCAuthenticationParameter -BoundParameters $ValuesToCheck
$ValuesToCheck.Remove('Entries') | Out-Null

Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $ValuesToCheck)"

Expand Down

0 comments on commit 720224b

Please sign in to comment.