Skip to content

Commit

Permalink
Merge pull request microsoft#5267 from ricmestre/fixexoarcconfig
Browse files Browse the repository at this point in the history
EXOArcConfig: Fix Test-TargetResource
  • Loading branch information
NikCharlebois authored Oct 26, 2024
2 parents 9224062 + 0f822b0 commit 2d473b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
* Initial release.
* AzureBillingAccountsRoleAssignment
* Initial release.
* EXOArcConfig
* Fixed `Test-TargetResource` to correctly check property `ArcTrustedSealers`
when it has an array
* EXOMailboxAuditBypassAssociation
* Initial release.
* EXOTenantAllowBlockListItems
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,17 @@ function Test-TargetResource
Write-Verbose -Message 'Testing configuration of Arc Config settings'

$CurrentValues = Get-TargetResource @PSBoundParameters
$ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone()

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

$ValuesToCheck = $PSBoundParameters

$ValuesToCheck = Remove-M365DSCAuthenticationParameter -BoundParameters $ValuesToCheck
# Need to remove Identity as Get-ArcConfig doesn't return Identity
$ValuesToCheck.Remove('Identity') | Out-Null

$PSBoundParameters.ArcTrustedSealers = $PSBoundParameters.ArcTrustedSealers -Join ','

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

$TestResult = Test-M365DSCParameterState -CurrentValues $CurrentValues `
-Source $($MyInvocation.MyCommand.Source) `
-DesiredValues $PSBoundParameters `
Expand Down

0 comments on commit 2d473b8

Please sign in to comment.