Skip to content

Commit

Permalink
inject task improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed Jul 15, 2024
1 parent 65b3480 commit 7a644bd
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ Function Invoke-ExecSetCIPPAutoBackup {
}
Remove-AzDataTableEntity @Table -Entity $task | Out-Null

$TaskBody = @{
$TaskBody = [pscustomobject]@{
TenantFilter = 'AllTenants'
Name = 'Automated CIPP Backup'
Command = @{
value = 'New-CIPPBackup'
label = 'New-CIPPBackup'
}
Parameters = @{ backupType = 'CIPP' }
Parameters = [pscustomobject]@{ backupType = 'CIPP' }
ScheduledTime = $unixtime
Recurrence = '1d'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ Function Invoke-ExecJITAdmin {
Set-CIPPUserJITAdmin @Parameters
}

$DisableTaskBody = @{
$DisableTaskBody = [pscustomobject]@{
TenantFilter = $Request.Body.TenantFilter
Name = "JIT Admin ($($Request.Body.ExpireAction)): $Username"
Command = @{
value = 'Set-CIPPUserJITAdmin'
label = 'Set-CIPPUserJITAdmin'
}
Parameters = @{
Parameters = [pscustomobject]@{
TenantFilter = $Request.Body.TenantFilter
User = @{
'UserPrincipalName' = $Username
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Function Invoke-ExecOffboardUser {
Command = @{
value = 'Invoke-CIPPOffboardingJob'
}
Parameters = @{
Parameters = [pscustomobject]@{
Username = $Username
APIName = 'Scheduled Offboarding'
options = $request.body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ Function Invoke-ExecCAExclusion {
}
if ($Request.body.vacation -eq 'true') {
$StartDate = $Request.body.StartDate
$TaskBody = @{
$TaskBody = [pscustomobject]@{
TenantFilter = $Request.body.TenantFilter
Name = "Add CA Exclusion Vacation Mode: $Username - $($Request.body.TenantFilter)"
Command = @{
value = 'Set-CIPPCAExclusion'
label = 'Set-CIPPCAExclusion'
}
Parameters = @{
Parameters = [pscustomobject]@{
ExclusionType = 'Add'
UserID = $Request.body.UserID
PolicyId = $Request.body.PolicyId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ function Register-CIPPExtensionScheduledTasks {
if (!$ExistingPushTask -or $Reschedule.IsPresent) {
# push cached data to extension
$in30mins = [int64](([datetime]::UtcNow.AddMinutes(30)) - (Get-Date '1/1/1970')).TotalSeconds
$Task = @{
$Task = [pscustomobject]@{
Name = "$Extension Extension Sync"
Command = @{
value = 'Push-CippExtensionData'
label = 'Push-CippExtensionData'
}
Parameters = @{
Parameters = [pscustomobject]@{
TenantFilter = $Tenant.defaultDomainName
Extension = $Extension
}
Expand Down

0 comments on commit 7a644bd

Please sign in to comment.