The "-Parallel" parameter is present in PowerShell 7. It's not present in PowerShell 5. Which version of PowerShell are you using?
How to use ForEach-Object -Parallel in Azure Devops Pipeline Agent.
Ramakrishna Abhijeet P
70
Reputation points
I want to use a PowerShell script which has below cmdlet. When I tried to use MS Hosted Pipeline agent with Parallel feature I'm getting "Parameter set cannot be resolved using the specified named parameters" error. How can I execute the script.
ForEach-Object -Parallel $scriptBlock