Powershell v3 comes with all these new job-scheduling cmdlets. They look great, but I'm having trouble creating a specific trigger. I need to run a job daily, repeating itself every hour, for a specific interval.
Using the Task-Scheduler UI is straightforward, but I can't find my way around the New-JobTrigger cmdlet.
If I use the Daily parameter-set, I don't have the Repetition option:
New-JobTrigger [-Daily] -At <DateTime> [-DaysInterval <Int32> ] [-RandomDelay <TimeSpan> ] [ <CommonParameters>]
If I use the Once parameter-set, I can't have the Daily option
New-JobTrigger [-Once] -At <DateTime> [-RandomDelay <TimeSpan> ] [-RepetitionDuration <TimeSpan> ] [-RepetitionInterval <TimeSpan> ] [ <CommonParameters>]
What I need, but obviously doesn't work, is a mix between the two. For example:
New-JobTrigger -Daily -At xxxx -RepetitionDuration (New-TimeSpan -Hours 5) -RepetitionInterval (New-TimeSpan -Hours 1)
Is it possible? Maybe mixing several triggers for the same job?