@@ -64,8 +64,8 @@ function Invoke-CIPPStandardSpamFilterPolicy {
6464
6565 try {
6666 $CurrentState = New-ExoRequest - TenantId $Tenant - cmdlet ' Get-HostedContentFilterPolicy' |
67- Where-Object - Property Name -EQ $PolicyName |
68- Select-Object - Property *
67+ Where-Object - Property Name -EQ $PolicyName |
68+ Select-Object - Property *
6969 } catch {
7070 $ErrorMessage = Get-NormalizedError - Message $_.Exception.Message
7171 Write-LogMessage - API ' Standards' - Tenant $Tenant - Message " Could not get the SpamFilterPolicy state for $Tenant . Error: $ErrorMessage " - Sev Error
@@ -136,8 +136,8 @@ function Invoke-CIPPStandardSpamFilterPolicy {
136136 $AcceptedDomains = New-ExoRequest - TenantId $Tenant - cmdlet ' Get-AcceptedDomain'
137137
138138 $RuleState = New-ExoRequest - TenantId $Tenant - cmdlet ' Get-HostedContentFilterRule' |
139- Where-Object - Property Name -EQ $PolicyName |
140- Select-Object - Property *
139+ Where-Object - Property Name -EQ $PolicyName |
140+ Select-Object - Property *
141141
142142 $RuleStateIsCorrect = ($RuleState.Name -eq $PolicyName ) -and
143143 ($RuleState.HostedContentFilterPolicy -eq $PolicyName ) -and
@@ -305,9 +305,9 @@ function Invoke-CIPPStandardSpamFilterPolicy {
305305 MarkAsSpamWebBugsInHtml = $MarkAsSpamWebBugsInHtml
306306 MarkAsSpamSensitiveWordList = $MarkAsSpamSensitiveWordList
307307 EnableLanguageBlockList = $Settings.EnableLanguageBlockList
308- LanguageBlockList = if ( $Settings.EnableLanguageBlockList -eq $true ) { $ Settings.LanguageBlockList.value } else { @ () }
308+ LanguageBlockList = $Settings.EnableLanguageBlockList ? @ ( $ Settings.EnableLanguageBlockList ) : @ ()
309309 EnableRegionBlockList = $Settings.EnableRegionBlockList
310- RegionBlockList = if ( $Settings.EnableRegionBlockList -eq $true ) { $ Settings.RegionBlockList.value } else { @ () }
310+ RegionBlockList = $Settings.RegionBlockList.value ? @ ( $ Settings.RegionBlockList.value ) : @ ()
311311 AllowedSenderDomains = $Settings.AllowedSenderDomains.value ?? @ ()
312312 }
313313 Set-CIPPStandardsCompareField - FieldName ' standards.SpamFilterPolicy' - CurrentValue $CurrentValue - ExpectedValue $ExpectedValue - Tenant $Tenant
0 commit comments