Forum Discussion
AmbiguousParameterSet with ForEach-Object -parallel
"Parallel running script block. Beginning with PowerShell 7.0, a third parameter set is available that runs each script block in parallel. The ThrottleLimit parameter limits the number of parallel scripts running at a time. As before, use the $_ variable to represent the current input object in the script block. Use the $using: keyword to pass variable references to the running script."
Then https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/foreach-object?view=powershell-7.2#example-11--run-slow-script-in-parallel-batches
I don't think it's gonna work and I don't see how I would use it.
Also, https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/foreach-object?view=powershell-7.2#example-11--run-slow-script-in-parallel-batches
This suggest that my $_. should work.
I think I'm lost in translation 😄
- Feb 24, 2022No problem and if you do manage to fix it, please report back 🙂
- John_DodoFeb 24, 2022Brass Contributorthank you for your help anyway, I'll just let my script run 45mins for now.