Windows task scheduler wrapper

Awhile back, there was some discussion about perhaps moving the task scheduler wrapper I wrote as part of win_updates into the standard Powershell Ansible module boilerplate. I’m not a fan of that, because I’d hate to ship that code around for every single Powershell invocation when there are only limited circumstances under which it should be used. However, it seems like there have been other cases lately where reasonably robust scheduled task support is needed (eg, https://github.com/ansible/ansible-modules-extras/pull/1007). Rather than splatter duplicate copies of a task scheduler wrapper across several modules (with the requisite risk for drift, etc), I’d be amenable to moving it into a different module replacer file that would only be opted-in by modules that needed it.

Anyone else have an opinion? I won’t have time to work on this for a bit- got a couple more things I’m hoping to slide into 2.0, but this could definitely be a 2.1 thing.

-Matt

This makes a lot of sense to me.

I was wondering if a module replacer file might be the way to go for modules that need to pass credentials to the windows host (to avoid the second hop problem), although I notice 2.0 has changed the way args are sent so maybe less of an issue.

Jon