Skip to content

Commit b422922

Browse files
authored
Merge pull request #377 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents b60c71b + a1591da commit b422922

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Scheduler/Invoke-ListScheduledItems.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,18 @@ function Invoke-ListScheduledItems {
6161
$Tasks = $Tasks | Where-Object -Property Tenant -In $AllowedTenantDomains
6262
}
6363
$ScheduledTasks = foreach ($Task in $tasks) {
64+
if (!$Task.Tenant -or !$Task.Command) {
65+
continue
66+
}
67+
6468
if ($Task.Parameters) {
6569
$Task.Parameters = $Task.Parameters | ConvertFrom-Json -ErrorAction SilentlyContinue
6670
} else {
6771
$Task | Add-Member -NotePropertyName Parameters -NotePropertyValue @{}
6872
}
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)) {
7076
$Task.Recurrence = 'Once'
7177
}
7278
try {

Modules/CIPPCore/Public/Set-CIPPCAExclusion.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function Set-CIPPCAExclusion {
4343

4444
$RawJson = ConvertTo-Json -Depth 10 -InputObject $NewExclusions
4545
if ($PSCmdlet.ShouldProcess($PolicyId, "Add exclusion for $UserID")) {
46-
New-GraphPOSTRequest -uri "https://graph.microsoft.com/beta/identity/conditionalAccess/policies/$($CheckExisting.id)" -tenantid $tenantfilter -type PATCH -body $RawJSON -AsApp $true
46+
$null = New-GraphPOSTRequest -uri "https://graph.microsoft.com/beta/identity/conditionalAccess/policies/$($CheckExisting.id)" -tenantid $tenantfilter -type PATCH -body $RawJSON -AsApp $true
4747
}
4848
}
4949

@@ -65,7 +65,7 @@ function Set-CIPPCAExclusion {
6565
}
6666
$RawJson = ConvertTo-Json -Depth 10 -InputObject $NewExclusions
6767
if ($PSCmdlet.ShouldProcess($PolicyId, "Remove exclusion for $UserID")) {
68-
New-GraphPOSTRequest -uri "https://graph.microsoft.com/beta/identity/conditionalAccess/policies/$($CheckExisting.id)" -tenantid $tenantfilter -type PATCH -body $RawJSON -AsApp $true
68+
$null = New-GraphPOSTRequest -uri "https://graph.microsoft.com/beta/identity/conditionalAccess/policies/$($CheckExisting.id)" -tenantid $tenantfilter -type PATCH -body $RawJSON -AsApp $true
6969
}
7070
}
7171

0 commit comments

Comments
 (0)