Skip to content

Commit 60a2a7b

Browse files
Merge pull request KelvinTegelaar#1401 from kris6673/fix-defender-alert
fix: Refactor Get-CIPPAlertDefenderIncidents to return structured data
2 parents 937aaff + 52ec4f3 commit 60a2a7b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Modules/CIPPCore/Public/Alerts/Get-CIPPAlertDefenderIncidents.ps1

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ function Get-CIPPAlertDefenderIncidents {
1313
)
1414
try {
1515
$AlertData = New-GraphGetRequest -uri "https://graph.microsoft.com/v1.0/security/incidents?`$top=50&`$filter=status eq 'active'" -tenantid $TenantFilter | ForEach-Object {
16-
"Incident ID $($_.id): Created at $($_.createdDateTime). Severity: $($_.severity). `nIncident name: $($_.displayName). Incident URL: $($_.incidentWebUrl)."
16+
[PSCustomObject]@{
17+
IncidentID = $_.id
18+
CreatedAt = $_.createdDateTime
19+
Severity = $_.severity
20+
IncidentName = $_.displayName
21+
IncidentUrl = $_.incidentWebUrl
22+
Tenant = $TenantFilter
23+
}
1724
}
1825
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $AlertData
1926

0 commit comments

Comments
 (0)