How to quickly change multiple network adapter names across multiple VSS or VDS.
##change network lab
$myNetworkAdapters = Get-VM | Get-NetworkAdapter |?{$_.networkname -like "pg_windows_servers"}
$myVDPortGroup = Get-VirtualPortGroup -Name pg_windows_servers01
Set-NetworkAdapter -NetworkAdapter $myNetworkAdapters -Portgroup $myVDPortGroup -confirm:$false
### pg_linux_servers
$myNetworkAdapters = Get-VM | Get-NetworkAdapter |?{$_.networkname -like "pg_linux_servers"}
$myVDPortGroup = Get-VirtualPortGroup -Name pg_linux_servers01
Set-NetworkAdapter -NetworkAdapter $myNetworkAdapters -Portgroup $myVDPortGroup -confirm:$false
## storage01
$myNetworkAdapters = Get-VM | Get-NetworkAdapter |?{$_.networkname -like "pg_vsan_01"}
$myVDPortGroup = Get-VirtualPortGroup -Name pg_vstorage_01
Set-NetworkAdapter -NetworkAdapter $myNetworkAdapters -Portgroup $myVDPortGroup -confirm:$false
## storage02
$myNetworkAdapters = Get-VM | Get-NetworkAdapter |?{$_.networkname -like "pg_vsan_02"}
$myVDPortGroup = Get-VirtualPortGroup -Name pg_vstorage_02
Set-NetworkAdapter -NetworkAdapter $myNetworkAdapters -Portgroup $myVDPortGroup -confirm:$false
##change network lab
$myNetworkAdapters = Get-VM | Get-NetworkAdapter |?{$_.networkname -like "pg_windows_servers"}
$myVDPortGroup = Get-VirtualPortGroup -Name pg_windows_servers01
Set-NetworkAdapter -NetworkAdapter $myNetworkAdapters -Portgroup $myVDPortGroup -confirm:$false
### pg_linux_servers
$myNetworkAdapters = Get-VM | Get-NetworkAdapter |?{$_.networkname -like "pg_linux_servers"}
$myVDPortGroup = Get-VirtualPortGroup -Name pg_linux_servers01
Set-NetworkAdapter -NetworkAdapter $myNetworkAdapters -Portgroup $myVDPortGroup -confirm:$false
## storage01
$myNetworkAdapters = Get-VM | Get-NetworkAdapter |?{$_.networkname -like "pg_vsan_01"}
$myVDPortGroup = Get-VirtualPortGroup -Name pg_vstorage_01
Set-NetworkAdapter -NetworkAdapter $myNetworkAdapters -Portgroup $myVDPortGroup -confirm:$false
## storage02
$myNetworkAdapters = Get-VM | Get-NetworkAdapter |?{$_.networkname -like "pg_vsan_02"}
$myVDPortGroup = Get-VirtualPortGroup -Name pg_vstorage_02
Set-NetworkAdapter -NetworkAdapter $myNetworkAdapters -Portgroup $myVDPortGroup -confirm:$false