summaryrefslogtreecommitdiff
path: root/windows/win_scheduled_task.ps1
diff options
context:
space:
mode:
authorPeter Mounce <peter.mounce@just-eat.com>2015-05-02 17:24:30 +0100
committerPeter Mounce <peter.mounce@just-eat.com>2015-05-19 11:14:02 +0100
commit4fef779f09b0d3b8d7fd7fa893d54c4fc09f2475 (patch)
tree5b3f4a7048af4826797610c85d4fbb56f9bc3a72 /windows/win_scheduled_task.ps1
parent6f1d9fbbccea3c37f3ab672a544903297da311a5 (diff)
downloadansible-modules-extras-4fef779f09b0d3b8d7fd7fa893d54c4fc09f2475.tar.gz
caught out by syntax
Diffstat (limited to 'windows/win_scheduled_task.ps1')
-rw-r--r--windows/win_scheduled_task.ps15
1 files changed, 3 insertions, 2 deletions
diff --git a/windows/win_scheduled_task.ps1 b/windows/win_scheduled_task.ps1
index 763bfb53..52b68dd5 100644
--- a/windows/win_scheduled_task.ps1
+++ b/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