Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

New Task with trigger options in powershell

$
0
0

Hello, i am trying to create a new task but i am not able to configure the advanced options like:

- Trigger options: Repeat task every *** for a duration of *** 

I know i have to use the "-RepetitionDuration & -RepetitionInterval' but whenever is use the following input:
-RepetitionInterval  (New-TimeSpan -Minutes 30)

I get an error:

New-ScheduledTaskTrigger : Parameter set cannot be resolved using the specified named parameters.

At line:9 char:20

+         $trigger = New-ScheduledTaskTrigger -Daily -At 12:00 -RepetitionDuration ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidArgument: (:) [New-ScheduledTaskTrigger], ParameterBindingException

    + FullyQualifiedErrorId : AmbiguousParameterSet,New-ScheduledTaskTrigger

What should i type to get these triggers to work?



Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>