I am creating a scheduled task in powershell. I want the trigger to be every 15 minutest to the hour and 15 minutes past the hour.
How do I accomplish this with a New-ScheduledTaskTrigger?
You need to define it to have a RepetitionInterval and RepetitionDuration to get it to repeat.
I was unable to figure out how to set an
Indefinite duration for the repeat, but I got it to repeat until 2036 by doing:
$span = New-TimeSpan -End "2036-01-01" $trigger = New-ScheduledTaskTrigger -Once -At 00:15 -RepetitionInterval 00:30 -RepetitionDuration $span
And then registering the task.