Skip to content

Commit 4463cc6

Browse files
committed
Improve error logging in Get-CIPPAlertRestrictedUsers
Replaces Write-AlertMessage with Write-LogMessage for better error reporting, including severity, API context, and detailed exception data.
1 parent e97d981 commit 4463cc6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $AlertData
3838
}
3939
} catch {
40-
Write-AlertMessage -tenant $($TenantFilter) -message "Could not get restricted users for $($TenantFilter): $(Get-NormalizedError -message $_.Exception.message)"
40+
Write-LogMessage -tenant $($TenantFilter) -message "Could not get restricted users for $($TenantFilter): $(Get-NormalizedError -message $_.Exception.message)" -severity 'Error' -API 'Get-CIPPAlertRestrictedUsers' -LogData (Get-CippException -Exception $_)
4141
}
4242
}

0 commit comments

Comments
 (0)