File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Modules/CIPPCore/Public/Entrypoints/Activity Triggers Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -272,7 +272,12 @@ function Push-ExecScheduledCommand {
272272
273273 # Add alert comment if available
274274 if ($task.AlertComment ) {
275- $HTML += " <div style='background-color: #f8f9fa; border-left: 4px solid #007bff; padding: 15px; margin: 15px 0;'><h4 style='margin-top: 0; color: #007bff;'>Alert Information</h4><p style='margin-bottom: 0;'>$ ( $task.AlertComment ) </p></div>"
275+ if ($task.AlertComment -match ' %resultcount%' ) {
276+ $resultCount = if ($Results -is [array ]) { $Results.Count } else { 1 }
277+ $task.AlertComment = $task.AlertComment -replace ' %resultcount%' , " $resultCount "
278+ }
279+ $task.AlertComment = Get-CIPPTextReplacement - Text $task.AlertComment - TenantFilter $Tenant
280+ $HTML += " <div style='background-color: transparent; border-left: 4px solid #007bff; padding: 15px; margin: 15px 0;'><h4 style='margin-top: 0; color: #007bff;'>Alert Information</h4><p style='margin-bottom: 0;'>$ ( $task.AlertComment ) </p></div>"
276281 }
277282
278283 $title = " $TaskType - $Tenant - $ ( $task.Name ) "
You can’t perform that action at this time.
0 commit comments