Skip to content

Commit b9b08f1

Browse files
Bugfix/issue 779 - fixed case when no filteredCApolicies exist (#1111)
* At least one CA policy targeting guests should exist for test to pass * update failure message when no enforcing CA policies exist
1 parent 87bc8db commit b9b08f1

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ function Test-Assessment-21824 {
5353
$passed = $false
5454
$testResultMarkdown = ""
5555

56-
if ($filteredCAPolicies.Count -eq $matchedPolicies.Count) {
56+
if ($filteredCAPolicies.Count -eq 0) {
57+
$passed = $false
58+
$testResultMarkdown = "No Conditional Access policies are targeting guests or external users. Sign-in frequency for guests is not enforced.`n`n%TestResult%"
59+
}
60+
elseif ($filteredCAPolicies.Count -eq $matchedPolicies.Count) {
5761
$passed = $true
5862
$testResultMarkdown = "Guests don't have long lived sign-in sessions.`n`n%TestResult%"
5963
}
@@ -76,7 +80,7 @@ function Test-Assessment-21824 {
7680
7781
## {0}
7882
79-
| Policy Name | Sign-in Frequency | Status |
83+
| Policy name | Sign-in frequency | Status |
8084
| :---------- | :---------------- | :----- |
8185
{1}
8286

0 commit comments

Comments
 (0)