Task Scheduler Resource

Hi All,

Is there any resource available in DSC kit using which I can schedule a task in Windows Server 2012 ?
If there is no resource how can I achieve the below powershell code in DSC?

schtasks /create /tn “IISLogRetention” /tr “powershell.exe $executionpath” /sc daily /st 03:00:00 /ru System

Thanks,
Aravinda

You can see the complete DSC Resource Kit at https://gallery.technet.microsoft.com/scriptcenter/DSC-Resource-Kit-All-c449312d. As you can see, there doesn’t appear to currently be a resource for managing scheduled tasks. That means you’d have to write your own resource.

The “Hey Scripting Guy” blog on Microsoft recently ran an entire series on managing scheduled tasks in PowerShell. You could probably use that as a starting point for authoring a resource. Mind you, the blog wasn’t about authoring resources - you’ll need to know how to do that.