'ForEach-Object -Parallel How to use it
I'm starting to use ForEach-Object -Parallel with PowerShell 7. I'm testing following code:
$MyArr = @()
$MyArr = (
('v1ne','rgNE'),`
('v1we','rgWE')
)
$MyArr | ForEach-Object -Parallel {
Start-AzVM -Name $MyArr[0] -ResourceGroupName $MyArr[1]
} -ThrottleLimit 10
To start up some virtual machine on azure in different Resource Groups. My idea is to get variable from array or from Azure automation variables. But I don't know how to pass different Resource Group Names in ForEach-Object -Parallel.
Any help is really appreciate.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
