Skip to content

Commit 5b57af4

Browse files
committed
updated write-alerttrace.ps1
Removed out-string to remove anomalous newline that breaks some comparisons
1 parent af7b5c7 commit 5b57af4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ function Get-CIPPAlertSmtpAuthSuccess {
2727
} catch {
2828
# Suppress errors if no data returned
2929
# Uncomment if you want explicit error logging
30-
Write-AlertMessage -tenant $($TenantFilter) -message "Failed to query SMTP AUTH sign-ins for $($TenantFilter): $(Get-NormalizedError -message $_.Exception.message)"
30+
# Write-AlertMessage -tenant $($TenantFilter) -message "Failed to query SMTP AUTH sign-ins for $($TenantFilter): $(Get-NormalizedError -message $_.Exception.message)"
3131
}
3232
}

Modules/CIPPCore/Public/GraphHelper/Write-AlertTrace.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ function Write-AlertTrace {
1515
$Row = Get-CIPPAzDataTableEntity @table -Filter "RowKey eq '$($tenantFilter)-$($cmdletName)' and PartitionKey eq '$PartitionKey'"
1616
try {
1717
$RowData = $Row.LogData
18-
$Compare = Compare-Object $RowData (ConvertTo-Json -InputObject $data -Compress -Depth 10 | Out-String)
18+
$Compare = Compare-Object $RowData (ConvertTo-Json -InputObject $data -Compress -Depth 10)
1919
if ($Compare) {
20-
$LogData = ConvertTo-Json -InputObject $data -Compress -Depth 10 | Out-String
20+
$LogData = ConvertTo-Json -InputObject $data -Compress -Depth 10
2121
$TableRow = @{
2222
'PartitionKey' = $PartitionKey
2323
'RowKey' = "$($tenantFilter)-$($cmdletName)"
@@ -31,7 +31,7 @@ function Write-AlertTrace {
3131
return $data
3232
}
3333
} catch {
34-
$LogData = ConvertTo-Json -InputObject $data -Compress -Depth 10 | Out-String
34+
$LogData = ConvertTo-Json -InputObject $data -Compress -Depth 10
3535
$TableRow = @{
3636
'PartitionKey' = $PartitionKey
3737
'RowKey' = "$($tenantFilter)-$($cmdletName)"

0 commit comments

Comments
 (0)