diff --git a/lib/ansible/modules/extras/windows/win_scheduled_task.ps1 b/lib/ansible/modules/extras/windows/win_scheduled_task.ps1 index e6effebb7b..b63bd13013 100644 --- a/lib/ansible/modules/extras/windows/win_scheduled_task.ps1 +++ b/lib/ansible/modules/extras/windows/win_scheduled_task.ps1 @@ -155,7 +155,6 @@ try { } 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 -Principal $principal $task = Get-ScheduledTask -TaskName $name Set-Attr $result "msg" "Added new task $name"