问题
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