File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Scheduler Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -61,12 +61,18 @@ function Invoke-ListScheduledItems {
61
61
$Tasks = $Tasks | Where-Object - Property Tenant -In $AllowedTenantDomains
62
62
}
63
63
$ScheduledTasks = foreach ($Task in $tasks ) {
64
+ if (! $Task.Tenant -or ! $Task.Command ) {
65
+ continue
66
+ }
67
+
64
68
if ($Task.Parameters ) {
65
69
$Task.Parameters = $Task.Parameters | ConvertFrom-Json - ErrorAction SilentlyContinue
66
70
} else {
67
71
$Task | Add-Member - NotePropertyName Parameters - NotePropertyValue @ {}
68
72
}
69
- if ($Task.Recurrence -eq 0 -or [string ]::IsNullOrEmpty($Task.Recurrence )) {
73
+ if (! $Task.Recurrence ) {
74
+ $Task | Add-Member - NotePropertyName Recurrence - NotePropertyValue ' Once' - Force
75
+ } elseif ($Task.Recurrence -eq 0 -or [string ]::IsNullOrEmpty($Task.Recurrence )) {
70
76
$Task.Recurrence = ' Once'
71
77
}
72
78
try {
You can’t perform that action at this time.
0 commit comments