Skip to content

Commit ab864ba

Browse files
committed
Fix 41035 report output and rule handling for user reporting assessment
1 parent f8105c4 commit ab864ba

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/powershell/tests/Test-Assessment.41035.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,11 @@ function Test-Assessment-41035 {
212212
$chatResult = if ($policy.ReportChatMessageEnabled -eq $true) { '✅ Pass' } else { '❌ Fail' }
213213
$postResult = if ($policy.PostSubmitMessageEnabled -eq $true) { '✅ Pass' } else { '⚠️ Investigate' }
214214

215-
# Rule state and SentTo — Investigate when customMailboxComplete but rule does not deliver
216-
$ruleStateName = if ($null -eq $rule) { '' } else { "``$($rule.State)``" }
217-
$ruleStateResult = if ($customMailboxRuleProblem) { '⚠️ Investigate' } elseif ($null -eq $rule) { '❌ Fail' } elseif ($rule.State -eq 'Enabled') { '✅ Pass' } else { '⚠️ Investigate' }
218-
$ruleSentTo = if ($null -eq $rule -or [string]::IsNullOrWhiteSpace($rule.SentTo)) { '' } else { Get-SafeMarkdown -Text $rule.SentTo }
219-
$ruleSentToResult = if ($ruleDelivers) { '✅ Pass' } elseif ($customMailboxRuleProblem) { '⚠️ Investigate' } else { '❌ Fail' }
215+
# Rule state and SentTo — only applicable when the custom mailbox address lists are fully configured.
216+
$ruleStateName = if (-not $customMailboxComplete -or $null -eq $rule) { '' } else { "``$($rule.State)``" }
217+
$ruleStateResult = if (-not $customMailboxComplete) { '' } elseif ($customMailboxRuleProblem) { '⚠️ Investigate' } elseif ($rule.State -eq 'Enabled') { '✅ Pass' } else { '⚠️ Investigate' }
218+
$ruleSentTo = if (-not $customMailboxComplete -or $null -eq $rule -or [string]::IsNullOrWhiteSpace($rule.SentTo)) { '' } else { Get-SafeMarkdown -Text $rule.SentTo }
219+
$ruleSentToResult = if (-not $customMailboxComplete) { '' } elseif ($ruleDelivers) { '✅ Pass' } elseif ($customMailboxRuleProblem) { '⚠️ Investigate' } else { '⚠️ Investigate' }
220220

221221
$tableRows = ''
222222
$tableRows += "| EnableReportToMicrosoft | $(& $formatBool $policy.EnableReportToMicrosoft) | True (re-evaluation + model training) | $msResult |`n"

0 commit comments

Comments
 (0)