I have to create multiple job in my app. These jobs should be separated by 30 minutes apart starting at 17:00. My dilemma how to get 20 times in hour and minutes ( HH:MM) format starting at 17:00 ?? Onces i have those times , i can loop all jobs 30 minutes apart.
Thank you
So far i have tried
$ts = New-TimeSpan -Hours 17 -Minutes 00
But adding minutes to $ts not working
PS F:\> $ts.AddMinutes(30)
Method invocation failed because [System.TimeSpan] does not contain a method named 'addminutes'.
At line:1 char:1
+ $ts.AddMinutes(30)
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound
>Solution :
You can simply add a new timespan:
$newts = $ts + (New-TimeSpan -Minutes 30)