Add 'StopExisting' as a valid argument for New-ScheduledSettingsSet -MultipleInstances
Only Parallel, Queue, and IgnoreNew are supported right now. One would expect that the option available from the Task Scheduler GUI would be available in the powershell interface.
Steps to reproduce
$a = New-ScheduledTaskSettingsSet -MultipleInstances StopExisting
The task's multiple instances policy is set to kill existing tasks before starting another instance.
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], ParameterBindingArgumentTransformationE
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,New-ScheduledTaskSettingsSet
According to this question on stackoverflow, it has been reported, but Microsoft Connect no longer is alive, so I couldn't follow the bug. Google searching powershell bug report brought me here, not sure if it's the right place though.