ForEach-Object -Parallel Parameter set cannot be resolved

痞子三分冷 提交于 2021-01-28 09:02:28

问题


When using powershell and following this article running the following example throws an error.

Example:
1..5 | ForEach-Object -Parallel { "Hello $_"; sleep 1; } -ThrottleLimit 5

Error:
ForEach-Object : Parameter set cannot be resolved using the specified named parameters.

Removing the body of the loop does not resolve the issue. It is present whenever using the -Parallel keyword.

The article is from last year which makes me think the feature must still be present in powershell. Am I missing something obvious here?

来源:https://stackoverflow.com/questions/62379047/foreach-object-parallel-parameter-set-cannot-be-resolved

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!