File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Security Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,10 @@ Function Invoke-ExecAlertsList {
43
43
}
44
44
45
45
$DisplayableAlerts = New-FlatArray $AlertsObj | Where-Object { $null -ne $_.Id } | Sort-Object - Property EventDateTime - Descending
46
+ if (! $DisplayableAlerts ) {
47
+ $DisplayableAlerts = @ ()
48
+ }
49
+ $Metadata = [PSCustomObject ]@ {}
46
50
47
51
[PSCustomObject ]@ {
48
52
NewAlertsCount = $DisplayableAlerts | Where-Object { $_.Status -eq ' newAlert' } | Measure-Object | Select-Object - ExpandProperty Count
@@ -51,7 +55,7 @@ Function Invoke-ExecAlertsList {
51
55
SeverityMediumAlertsCount = $DisplayableAlerts | Where-Object { ($_.Status -eq ' inProgress' ) -or ($_.Status -eq ' newAlert' ) } | Where-Object { $_.Severity -eq ' medium' } | Measure-Object | Select-Object - ExpandProperty Count
52
56
SeverityLowAlertsCount = $DisplayableAlerts | Where-Object { ($_.Status -eq ' inProgress' ) -or ($_.Status -eq ' newAlert' ) } | Where-Object { $_.Severity -eq ' low' } | Measure-Object | Select-Object - ExpandProperty Count
53
57
SeverityInformationalCount = $DisplayableAlerts | Where-Object { ($_.Status -eq ' inProgress' ) -or ($_.Status -eq ' newAlert' ) } | Where-Object { $_.Severity -eq ' informational' } | Measure-Object | Select-Object - ExpandProperty Count
54
- MSResults = $DisplayableAlerts
58
+ MSResults = @ ( $DisplayableAlerts )
55
59
}
56
60
} else {
57
61
$Table = Get-CIPPTable - TableName cachealertsandincidents
You can’t perform that action at this time.
0 commit comments