Categories
Development

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

Source: https://windowsserver.uservoice.com/forums/301869-powershell/category/148044/filters/new?page=4

Leave a Reply

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