LucD
Leadership
Leadership

To use the Portgroup, you could do something like this

$vmNic = (Get-NetworkAdapter -VM $vm | where{$_.NetworkName -eq <your-portgroup-name>}).ExtensionData

To use the vNIC label, you can use the same logic as in  https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Remove-Port-Mirroring/td-p/2250195/jum... 


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