Only Parallel, Queue, and IgnoreNew are supported right now. How to enable “stop the existing instance” [duplicate]

Steps to reproduce

$a = New-ScheduledTaskSettingsSet -MultipleInstances StopExisting

Expected behavior

The task’s multiple instances policy is set to kill existing tasks before starting another instance.

Actual behavior

value "StopExisting" to type "Microsoft.PowerShell.Cmdletization.GeneratedTypes.ScheduledTask.MultipleInstancesEnum".
Error: "Unable to match the identifier name StopExisting to a valid enumerator name. Specify one of the following
enumerator names and try again:
Parallel, Queue, IgnoreNew"
At line:1 char:131
+ ... ngOnBatteries -ExecutionTimeLimit $b -MultipleInstances StopExisting
+ ~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [New-ScheduledTaskSettingsSet], ParameterBindingArgumentTransformationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,New-ScheduledTaskSettingsSet


Leave a Reply

Your email address will not be published. Required fields are marked *