diff --git a/Function/Set-ScheduledTask.ps1 b/Function/Set-ScheduledTask.ps1 index c42a7b4..ef177dc 100644 --- a/Function/Set-ScheduledTask.ps1 +++ b/Function/Set-ScheduledTask.ps1 @@ -66,7 +66,7 @@ switch ($method) { #Overall task comparison Write-Debug "DEBUG: Scheduled task: $task" - + #Fail condition if ($null -eq $task) { Write-Progress -Activity "Testing Scheduled Task" -CurrentOperation "Comparison failed - Task Missing" -Completed -Id 1 @@ -74,13 +74,13 @@ switch ($method) { } $Test_ScriptResult = Test-ScheduledTaskScript - + $Test_DescResult = ( $task.Description -eq $TaskDesc ) Write-Progress -Activity "Testing Scheduled Task" -CurrentOperation "Description Comparison finished with result: $Test_DescResult" -PercentComplete 80 -Id 1 $TestResult = ( $Test_DescResult -and $Test_ScriptResult ) Write-Progress -Activity "Testing Scheduled Task" -CurrentOperation "Validation finished with result: $TestResult" -Completed -Id 1 - + $TestResult } @@ -101,7 +101,7 @@ switch ($method) { } Write-Debug "DEBUG: Trigger is set to $($using:Trigger)" Write-Debug "DEBUG: Build Trigger: $buildtrigger" - + # Check if the task exists and remove it if it does if (![string]::IsNullOrWhiteSpace($using:task)){ Unregister-ScheduledTask -TaskName $using:TaskName -Confirm:$false