I need to reselect the PG (not change) the PG on each vm.
how do it per vm with set-networkadapter -networkname ....
would something like this work?
Yes, something like this should do the trick.
ForEach-Object -Process {
Get-NetworkAdapter -VM $_ |
Set-NetworkAdapter -NetworkName $_.NetworkName -Confirm:$false -RunAsync
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi Luc
I got this
I started with
get-vm -name vm1, vm2 |
ForEach-Object -Process {
Get-NetworkAdapter -VM $_ |
Set-NetworkAdapter -NetworkName $_.NetworkName -Confirm:$false -RunAsync
}
Try like this then
ForEach-Object -Process {
Get-NetworkAdapter -VM $_ |
ForEach-Object -Process {
Set-NetworkAdapter -NetworkAdapter $_ -NetworkName $_.NetworkName -Confirm:$false
}
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference