Skip to content

Commit 0400251

Browse files
committed
fix: object prop updated by ref causing table err
1 parent d029fa4 commit 0400251

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Modules/CIPPCore/Public/New-CIPPAlertTemplate.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ function New-CIPPAlertTemplate {
3131
$DataHTML = foreach ($object in $data) {
3232
"<p>For the standard $($object.standardName) in template {{Template Name }} we've detected the following:</p> <li>$($object.message)</li>"
3333
if ($object.object) {
34-
$object.object = $object.object | ConvertFrom-Json
35-
$object.object = $object.object | Select-Object * -ExcludeProperty Etag, PartitionKey, TimeStamp
36-
if ($object.object.compare) {
34+
$StandardObject = $object.object | ConvertFrom-Json
35+
$StandardObject = $newobject | Select-Object * -ExcludeProperty Etag, PartitionKey, TimeStamp
36+
if ($StandardObject.compare) {
3737
'<p>The following differences have been detected:</p>'
38-
($object.object.compare | ConvertTo-Html -Fragment | Out-String).Replace('<table>', ' <table class="table-modern">')
38+
($StandardObject.compare | ConvertTo-Html -Fragment | Out-String).Replace('<table>', ' <table class="table-modern">')
3939
} else {
4040
'<p>This is a table representation of the current settings:</p>'
41-
($object.object | ConvertTo-Html -Fragment -As List | Out-String).Replace('<table>', ' <table class="table-modern">')
41+
($StandardObject | ConvertTo-Html -Fragment -As List | Out-String).Replace('<table>', ' <table class="table-modern">')
4242
}
4343
}
4444

0 commit comments

Comments
 (0)