Skip to content

Commit

Permalink
Merge pull request #731 from Azure/730-counts-for-expired-orphaned-ex…
Browse files Browse the repository at this point in the history
…emptions-are-not-incrementing

Update Exemption Counts
  • Loading branch information
sterit authored Aug 19, 2024
2 parents 39bf6c9 + c4aa567 commit dac4264
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Scripts/Helpers/Build-ExemptionsPlan.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ function Build-ExemptionsPlan {
else {
Write-Warning "Exemption entry $($entryNumber): Exemption '$name' in definitions expired $( - $daysUntilExpired) days ago."
}
$Exemptions.numberOfExpired++
}
elseif ($daysUntilExpired -le 15) {
Write-Warning "Exemption entry $($entryNumber): Exemption '$name' in definitions expires in $daysUntilExpired days."
Expand Down Expand Up @@ -578,6 +579,7 @@ function Build-ExemptionsPlan {
}
if ($resourceStatus -eq "individualResourceDoesNotExists") {
Write-Warning "Row $($entryNumber): Resource '$currentScope' does not exist, skipping entry."
$Exemptions.numberOfOrphans++
}
}
else {
Expand Down Expand Up @@ -672,6 +674,7 @@ function Build-ExemptionsPlan {
}
if ($filteredPolicyAssignments.Count -eq 0) {
Write-Warning "Exemption entry $($entryNumber): No assignments found for exemption scope $($currentScope), skipping entry."
$Exemptions.numberOfOrphans++
continue
}
}
Expand Down

0 comments on commit dac4264

Please sign in to comment.