现在仅支持Parallel,Queue和IgnoreNew。如何启用“停止现有实例”

时间:2019-11-13 15:34:08

标签: windows powershell server powershell-4.0

复制步骤

$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

0 个答案:

没有答案