Skip to content

Commit

Permalink
check if tasks is null
Browse files Browse the repository at this point in the history
  • Loading branch information
kmaranionjc committed Aug 29, 2023
1 parent 0351171 commit 61e0662
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions jumpcloud-ADMU/Powershell/Start-Migration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2124,7 +2124,12 @@ Function Start-Migration {
}

# re-enable scheduled tasks if they were disabled
SetScheduledTask -op "enable" -scheduledTasks $ScheduledTasks
if ($ScheduledTasks) {
SetScheduledTask -op "enable" -scheduledTasks $ScheduledTasks
} else {
Write-ToLog -Message:('No Scheduled Tasks to enable')
}

# Cleanup Folders Again Before Reboot
Write-ToLog -Message:('Removing Temp Files & Folders.')
try {
Expand Down Expand Up @@ -2170,7 +2175,11 @@ Function Start-Migration {
}
$FixedErrors += "$trackedStep"
# Create a list of scheduled tasks that are disabled
SetScheduledTask -op "enable" -scheduledTasks $ScheduledTasks
if ($ScheduledTasks) {
SetScheduledTask -op "enable" -scheduledTasks $ScheduledTasks
} else {
Write-ToLog -Message:('No Scheduled Tasks to enable')
}
}

Default {
Expand Down

0 comments on commit 61e0662

Please sign in to comment.