Missing trigger options in New-ScheduledTaskTrigger
Votes from Connect: 3
Original Date Submitted: 10/30/2014 5:41:25 PM
Site Name: PowerShell
Feedback ID: 1015225
Frequency: Always Happens
Regression: Yes, this happens in all previous versions
New-ScheduledTaskTrigger offers just a subset of the trigger options. Things like "On an (event log) event", or "On workstation (un)lock" are missing.
We just found ugly workarounds to add these (e.g. event log) triggers by using "schtasks.exe /create /xml" or using the COM "TaskScheduler" class.
New-ScheduledTaskTrigger should allow specifying all options the Task Scheduler UI offers. As there already exists an XML representation of these triggers (e.g. <EventTrigger>, <SessionStateChangeTrigger>, ...) it would also be possible to offer a "-Custom" parameter which takes such an XML fragment to specify a trigger.
Product Studio item created by Connect Synchronizer due to creation of feedback ID 1015225 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=1015225).
Internal BugId: 13076
Al Brough commented
New-ScheduledTaskTrigger should include a Monthly parameter. This is a standard option with Task scheduler
Tony Sperbeck commented
What I just noticed is that the "On an event" trigger is now missing from the GUI for Windows Server 2016. I have not found any Microsoft documentation on this change. Has anyone else?
Dominique Clijsters commented
New-ScheduledTaskTrigger should also have a trigger Option for RegistrationTriggers (On Creation / Updation), as they also can be created on theSchTasks UI.