I have been attempting to execute parallel commands on data (such as a list of Server Names) that is imported via CSV and called by ForEach-Object. I have found that foreach has a parallel method but it appears that ForEach-Object does not. I am concerned about good performance as I hit multiple servers to read log data, and have the following options:
1) PowerShell Workflow
2) PowerShell Background Job
3) Invoke-Command
When I tried option 3, it failed as I tried to send arguments via -ArgumentList, but it didn't seem to like the variables I was pushing from the CSV in the form of:
$($_.'CSVColumnValue')
Is it possible to execute commands in parallel using ForEach-Object, and if so, what is the recommended method to achieve this?