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 1
1
function Write-AlertTrace {
2
2
<#
3
3
. FUNCTIONALITY
4
- Internal function. Pleases most of write-alertmessage for alerting purposes
4
+ Internal function. Pleases most of Write-AlertTrace for alerting purposes
5
5
#>
6
6
Param (
7
7
$cmdletName ,
8
8
$data ,
9
9
$tenantFilter
10
- )
10
+ )
11
11
$Table = Get-CIPPTable - tablename AlertLastRun
12
12
$PartitionKey = (Get-Date - UFormat ' %Y%m%d' ).ToString()
13
13
# Get current row and compare the $logData object. If it's the same, don't write it.
14
14
$Row = Get-CIPPAzDataTableEntity @table - Filter " RowKey eq '$ ( $tenantFilter ) -$ ( $cmdletName ) ' and PartitionKey eq '$PartitionKey '"
15
15
try {
16
16
$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 )
18
18
if ($Compare ) {
19
- $LogData = ConvertTo-Json $data - Compress - Depth 10 | Out-String
19
+ $LogData = ConvertTo-Json - InputObject $data - Compress - Depth 10 | Out-String
20
20
$TableRow = @ {
21
21
' PartitionKey' = $PartitionKey
22
22
' RowKey' = " $ ( $tenantFilter ) -$ ( $cmdletName ) "
@@ -27,7 +27,7 @@ function Write-AlertTrace {
27
27
return $data
28
28
}
29
29
} catch {
30
- $LogData = ConvertTo-Json $data - Compress - Depth 10 | Out-String
30
+ $LogData = ConvertTo-Json - InputObject $data - Compress - Depth 10 | Out-String
31
31
$TableRow = @ {
32
32
' PartitionKey' = $PartitionKey
33
33
' RowKey' = " $ ( $tenantFilter ) -$ ( $cmdletName ) "
@@ -38,4 +38,4 @@ function Write-AlertTrace {
38
38
return $data
39
39
}
40
40
41
- }
41
+ }
You can’t perform that action at this time.
0 commit comments