复制步骤
$a = New-ScheduledTaskSettingsSet -MultipleInstances StopExisting
预期行为
任务的多实例策略设置为在启动另一个实例之前杀死现有任务。
实际行为
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
来源:https://windowsserver.uservoice.com/forums/301869-powershell/category/148044/filters/new?page=4