File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Modules/CIPPCore/Public/GraphHelper Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 11function Write-AlertTrace {
22 <#
33 . FUNCTIONALITY
4- Internal function. Pleases most of write-alertmessage for alerting purposes
4+ Internal function. Pleases most of Write-AlertTrace for alerting purposes
55 #>
66 Param (
77 $cmdletName ,
88 $data ,
99 $tenantFilter
10- )
10+ )
1111 $Table = Get-CIPPTable - tablename AlertLastRun
1212 $PartitionKey = (Get-Date - UFormat ' %Y%m%d' ).ToString()
1313 # Get current row and compare the $logData object. If it's the same, don't write it.
1414 $Row = Get-CIPPAzDataTableEntity @table - Filter " RowKey eq '$ ( $tenantFilter ) -$ ( $cmdletName ) ' and PartitionKey eq '$PartitionKey '"
1515 try {
1616 $RowData = $Row.LogData
17- $Compare = Compare-Object $RowData ($data | ConvertTo-Json - Compress - Depth 10 | Out-String )
17+ $Compare = Compare-Object $RowData (ConvertTo-Json - InputObject $data - Compress - Depth 10 | Out-String )
1818 if ($Compare ) {
19- $LogData = ConvertTo-Json $data - Compress - Depth 10 | Out-String
19+ $LogData = ConvertTo-Json - InputObject $data - Compress - Depth 10 | Out-String
2020 $TableRow = @ {
2121 ' PartitionKey' = $PartitionKey
2222 ' RowKey' = " $ ( $tenantFilter ) -$ ( $cmdletName ) "
@@ -27,7 +27,7 @@ function Write-AlertTrace {
2727 return $data
2828 }
2929 } catch {
30- $LogData = ConvertTo-Json $data - Compress - Depth 10 | Out-String
30+ $LogData = ConvertTo-Json - InputObject $data - Compress - Depth 10 | Out-String
3131 $TableRow = @ {
3232 ' PartitionKey' = $PartitionKey
3333 ' RowKey' = " $ ( $tenantFilter ) -$ ( $cmdletName ) "
@@ -38,4 +38,4 @@ function Write-AlertTrace {
3838 return $data
3939 }
4040
41- }
41+ }
You can’t perform that action at this time.
0 commit comments