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
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,628 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,926 questions