VMware Cloud Community
tdubb123
Expert
Expert

powercli rename Standard PGs

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...

0 Kudos
2 Replies
tdubb123
Expert
Expert

any idea?

something like this?

Foreach ($PG in (get-cluster xxx| get-vmhost | get-virtualportgroup STD-PG-net-*)) {

Set-virtualportgroup -name .....

0 Kudos
LucD
Leadership
Leadership

Try something like this

Get-VirtualPortGroup -Standard -Name *_24 |

ForEach-Object -Process {

   Set-VirtualPortGroup -VirtualPortGroup $_ -Name "$($_.Name.Replace('_24',''))" -Confirm:$false

}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos