Skip to content

Commit f34bbcb

Browse files
committed
Replace Write-AlertMessage with Write-LogMessage in TERRL alert
Updated the error handling in Get-CIPPAlertTERRL.ps1 to use Write-LogMessage instead of Write-AlertMessage, adding more detailed logging with severity, API, and exception data.
1 parent d79fc49 commit f34bbcb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ function Get-CIPPAlertTERRL {
3535
}
3636
}
3737
} catch {
38-
Write-AlertMessage -tenant $($TenantFilter) -message "Could not get TERRL status for $($TenantFilter): $(Get-NormalizedError -message $_.Exception.message)"
38+
Write-LogMessage -tenant $($TenantFilter) -message "Could not get TERRL status for $($TenantFilter): $(Get-NormalizedError -message $_.Exception.message)" -severity 'Error' -API 'CIPPAlertTERRL' -LogData (Get-CippException -Exception $_)
3939
}
4040
}

0 commit comments

Comments
 (0)