Skip to content

Commit aa175cb

Browse files
committed
force excludedTenants to be an array
1 parent 82cdf68 commit aa175cb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Administration/Alerts/Invoke-ListAlertsQueue.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Function Invoke-ListAlertsQueue {
3333
$TaskEntry = [PSCustomObject]@{
3434
Tenants = @($Tenants.label)
3535
Conditions = $TranslatedConditions
36-
excludedTenants = ($Task.excludedTenants | ConvertFrom-Json -Depth 10 -ErrorAction SilentlyContinue)
36+
excludedTenants = @($Task.excludedTenants | ConvertFrom-Json -Depth 10 -ErrorAction SilentlyContinue)
3737
Actions = $TranslatedActions
3838
LogType = $Task.type
3939
EventType = 'Audit log Alert'
@@ -64,10 +64,16 @@ Function Invoke-ListAlertsQueue {
6464
}
6565

6666
foreach ($Task in $ScheduledTasks) {
67+
if ($Task.excludedTenants) {
68+
$ExcludedTenants = @($Task.excludedTenants)
69+
} else {
70+
$ExcludedTenants = @()
71+
}
72+
6773
$TaskEntry = [PSCustomObject]@{
6874
RowKey = $Task.RowKey
6975
PartitionKey = $Task.PartitionKey
70-
excludedTenants = $Task.excludedTenants
76+
excludedTenants = @($ExcludedTenants)
7177
Tenants = @($Task.Tenant)
7278
Conditions = $Task.Name
7379
Actions = $Task.PostExecution

0 commit comments

Comments
 (0)