I'm looking for a way to list all VM's on a machine by the type of mirroring they have set using PowerShell.
For Example:
Get-VM -PortMirroring Source
And I'll see all VM's that have network adapters with Port Mirroring set to Source. But I know that Get-VM doesn't take PortMirroring as a parameter, so I'm wondering if there is a workaround?
This is not this easy, as
PortMirroring
is not the property of a VM, but rather a property of its network adapter. You need to iterate VMs' network adapters and output VMs that have at least 1 adapter that hasPortMirroringMode
set to "Source".