From c2ba569bf4a916fe77b381345e3027485df760c4 Mon Sep 17 00:00:00 2001 From: Peter Mounce Date: Sat, 2 May 2015 17:24:30 +0100 Subject: [PATCH] caught out by syntax --- lib/ansible/modules/extras/windows/win_scheduled_task.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/windows/win_scheduled_task.ps1 b/lib/ansible/modules/extras/windows/win_scheduled_task.ps1 index 763bfb53862..52b68dd5b6a 100644 --- a/lib/ansible/modules/extras/windows/win_scheduled_task.ps1 +++ b/lib/ansible/modules/extras/windows/win_scheduled_task.ps1 @@ -50,8 +50,8 @@ else try { $tasks = Get-ScheduledTask -TaskPath $name - $tasks_needing_changing |? { $_.State -ne $state } - if ($tasks_needing_changing -eq $null) + $tasks_needing_changing = $tasks |? { $_.State -ne $state } + if (-not($tasks_needing_changing -eq $null)) { if ($state -eq 'Disabled') { @@ -69,6 +69,7 @@ try Set-Attr $result "tasks_changed" @() $result.changed = $false } + Exit-Json $result; } catch