I'm trying to create a task which will repeat every 5 minutes indefinitely through powershell. However, I cannot figure out a way to do this through all my searching. New-TimeSpan -Days 9999
appears to be the maximum value, and no matter what I do I cannot get the time to go over 9999 days.
Here's the trigger:
$trigger = New-ScheduledTaskTrigger -Once -At $date -RepetitionDuration (New-TimeSpan -Days 9999) -RepetitionInterval (New-TimeSpan -Minutes 5)
$PSVersionTable.PSVersion
reports what I assume to be v4, here's the output:
Major Minor Build Revision
4 0 -1 -1
1.0/0
aww it has to be integer – Refulgent