The complications and limitations of the PowerShell cmdlets outlined above led to writing a simplified set of PowerShell commands, where enabling port monitoring on external or internal switches gets as simple as:
Import-Module .\VMSwitchPortMonitorMode.psm1
Set-VMSwitchPortMonitorMode -SwitchName MySwitch -MonitorMode Source
The module is available here
How to check the status of port monitoring on a given switch:
PS C:\Dev> Get-VMSwitchPortMonitorMode MySwitch
PortType MonitorMode
-------- -----------
External Source>
Disabling monitoring is also very easy:
Set-VMSwitchPortMonitorMode -SwitchName MySwitch -MonitorMode None
Source: https://cloudbase.it/hyper-v-promiscuous-mode/