Skip to content

Commit ba59b21

Browse files
authored
Merge pull request #173 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 5a4f49c + 042d5d3 commit ba59b21

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Modules/CIPPCore/Public/New-CIPPAlertTemplate.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@ function New-CIPPAlertTemplate {
2121
$RuleTable = ''
2222
$Table = ''
2323
$LocationInfo = $LocationInfo ?? $Data.CIPPLocationInfo | ConvertFrom-Json -ErrorAction SilentlyContinue | Select-Object * -ExcludeProperty Etag, PartitionKey, TimeStamp
24+
if ($Data -is [string]) {
25+
$Data = @{ message = $Data }
26+
}
27+
if ($Data -is [array] -and $Data[0] -is [string]) {
28+
$Data = $Data | ForEach-Object { @{ message = $_ } }
29+
}
2430
if ($InputObject -eq 'table') {
31+
#data can be a array of strings or a string, if it is, we need to convert it to an object so it shows up nicely, that object will have one header: message.
32+
2533
$DataHTML = ($Data | Select-Object * -ExcludeProperty Etag, PartitionKey, TimeStamp | ConvertTo-Html | Out-String).Replace('<table>', ' <table class="table-modern">')
2634
$IntroText = "<p>You've configured CIPP to send you alerts based on the logbook. The following alerts match your configured rules</p>$dataHTML"
2735
$ButtonUrl = "$CIPPURL/cipp/logs"

Modules/CippExtensions/Public/Extension Functions/Register-CippExtensionScheduledTasks.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function Register-CIPPExtensionScheduledTasks {
2323
$CustomDataMappingTable = Get-CIPPTable -TableName CustomDataMappings
2424
$Mappings = Get-CIPPAzDataTableEntity @CustomDataMappingTable | ForEach-Object {
2525
$Mapping = $_.JSON | ConvertFrom-Json
26-
if ($Mapping.sourceType -eq 'extensionSync') {
26+
if ($Mapping.sourceType.value -eq 'extensionSync') {
2727
$TenantMappings = if ($Mapping.tenantFilter.value -contains 'AllTenants') {
2828
$Tenants
2929
} else {

0 commit comments

Comments
 (0)