Ansible Module: win_scheduled_task missing startup trigger

Hi,

I’m pushing a Task Scheduler to a Win2012 server with the ‘win_scheduled_task’ module. The task successfully applies however I would like to change the trigger to begin on startup. I don’t see an option with the module to change it to startup. Is using the win_scheduled_task my best option?

This is what i’m using.

- name: MyTaskSchedule
  win_scheduled_task:
     name: "Mytask"
     execute: "PowerShell.exe"
     argument: "-File C:\scripts\MyScript.ps1"

If you want something that starts when the machine does, maybe consider setting up a service, which you can do using the win_service module: http://docs.ansible.com/ansible/win_service_module.html

It looks like your task scheduler is a powershell script. If so you might need to make some changes to get it to work as a service - I found a page about doing this here: https://msdn.microsoft.com/en-us/magazine/mt703436.aspx

Hope this helps,

Jon