any idea how I can rename a bunch of standard PGs on multiple hosts
from
STD-PG-net-vlan100_24
to
STD-PG-net-vlan100
I have multiple
STD-PG-net-vlan100_24
STD-PG-net-vlan101_24
etc...
any idea?
something like this?
Foreach ($PG in (get-cluster xxx| get-vmhost | get-virtualportgroup STD-PG-net-*)) {
Set-virtualportgroup -name .....
Try something like this
ForEach-Object -Process {
Set-VirtualPortGroup -VirtualPortGroup $_ -Name "$($_.Name.Replace('_24',''))" -Confirm:$false
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference