diff options
author | Michael Perzel <michael.perzel@surescripts.com> | 2015-09-08 11:20:35 -0500 |
---|---|---|
committer | Michael Perzel <michael.perzel@surescripts.com> | 2015-09-08 11:20:35 -0500 |
commit | d0b4bc0dda729bb87a49ac1a7ccf281aa5a6c6d5 (patch) | |
tree | b8ad8e9294391b912bb3267f1e1a686df6feaa7f /windows/win_scheduled_task.ps1 | |
parent | a9eb69b0fa54d8299fddae23f6c89d4d0ebf7a6a (diff) | |
download | ansible-modules-extras-d0b4bc0dda729bb87a49ac1a7ccf281aa5a6c6d5.tar.gz |
Show order of operations with parenthesis
Diffstat (limited to 'windows/win_scheduled_task.ps1')
-rw-r--r-- | windows/win_scheduled_task.ps1 | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/windows/win_scheduled_task.ps1 b/windows/win_scheduled_task.ps1 index 85b54c89..5777d198 100644 --- a/windows/win_scheduled_task.ps1 +++ b/windows/win_scheduled_task.ps1 @@ -94,7 +94,7 @@ try { if ($measure.count -eq 1 ) { $exists = $true } - elseif ($measure.count -eq 0 -and $state -eq "absent" ){ + elseif ( ($measure.count -eq 0) -and ($state -eq "absent") ){ Set-Attr $result "msg" "Task does not exist" Exit-Json $result } @@ -120,13 +120,13 @@ try { } } - if ($state -eq "absent" -and $exists -eq $true) { + if ( ($state -eq "absent") -and ($exists -eq $true) ) { Unregister-ScheduledTask -TaskName $name -Confirm:$false $result.changed = $true Set-Attr $result "msg" "Deleted task $name" Exit-Json $result } - elseif ($state -eq "absent" -and $exists -eq $false) { + elseif ( ($state -eq "absent") -and ($exists -eq $false) ) { Set-Attr $result "msg" "Task $name does not exist" Exit-Json $result } @@ -138,14 +138,14 @@ try { $settings = New-ScheduledTaskSettingsSet } - if ($state -eq "present" -and $exists -eq $false){ + if ( ($state -eq "present") -and ($exists -eq $false) ){ $action = New-ScheduledTaskAction -Execute $execute Register-ScheduledTask -Action $action -Trigger $trigger -TaskName $name -Description $description -TaskPath $path -Settings $settings $task = Get-ScheduledTask -TaskName $name Set-Attr $result "msg" "Added new task $name" $result.changed = $true } - elseif($state -eq "present" -and $exists -eq $true) { + elseif( ($state -eq "present") -and ($exists -eq $true) ) { if ($task.Description -eq $description -and $task.TaskName -eq $name -and $task.TaskPath -eq $path -and $task.Actions.Execute -eq $execute -and $taskState -eq $enabled) { #No change in the task yet Set-Attr $result "msg" "No change in task $name" |