We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb16c2b commit 0351171Copy full SHA for 0351171
jumpcloud-ADMU/Powershell/Start-Migration.ps1
@@ -1586,7 +1586,12 @@ Function Start-Migration {
1586
$ScheduledTasks = Get-ScheduledTask | Where-Object { $_.TaskPath -notlike "*\Microsoft\Windows*" -and $_.State -ne "Disabled" -and $_.state -ne "Running" }
1587
# Disable tasks before migration
1588
Write-ToLog -message:("Disabling Scheduled Tasks...")
1589
- SetScheduledTask -op "disable" -scheduledTasks $ScheduledTasks
+ # Check if $ScheduledTasks is not null
1590
+ if ($ScheduledTasks) {
1591
+ SetScheduledTask -op "disable" -scheduledTasks $ScheduledTasks
1592
+ } else {
1593
+ Write-ToLog -message:("No Scheduled Tasks to disable")
1594
+ }
1595
}
1596
Process {
1597
# Start Of Console Output
0 commit comments