API Reference
Class
HyperVSwitchQuery
Queries native Hyper-V virtual switch inventory through the Hyper-V WMI v2 provider.
Inheritance
- Object
- HyperVSwitchQuery
Methods
public static List<HyperVSwitchInfo> Get(String computerName = null, String[] namePatterns = null, Nullable<TimeSpan> timeout = null) #Returns:
List<HyperVSwitchInfo>Gets Hyper-V virtual switches from root\virtualization\v2.
Parameters
- computerName System.String = null
- Target computer name. Blank or . uses the local computer.
- namePatterns System.String[] = null
- Optional wildcard patterns matched against switch name or WMI identity.
- timeout System.Nullable{System.TimeSpan} = null
- Optional WMI query timeout.
Returns
Virtual switch rows. Returns an empty list when Hyper-V WMI is unavailable.
public static async Task<List<HyperVSwitchInfo>> GetAsync(String computerName = null, String[] namePatterns = null, Nullable<TimeSpan> timeout = null, CancellationToken cancellationToken = null) #Returns:
Task<List<HyperVSwitchInfo>>Asynchronously gets Hyper-V virtual switches from root\virtualization\v2.
Parameters
- computerName System.String = null
- Target computer name. Blank or . uses the local computer.
- namePatterns System.String[] = null
- Optional wildcard patterns matched against switch name or WMI identity.
- timeout System.Nullable{System.TimeSpan} = null
- WMI query timeout.
- cancellationToken System.Threading.CancellationToken = null
- Cancellation token.
Returns
Virtual switch rows. Returns an empty list when Hyper-V WMI is unavailable.
Inherited Methods
public override Boolean Equals(Object obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object