API Reference
Class
HyperVVirtualDiskQuery
Queries native Hyper-V virtual disk inventory through the Hyper-V WMI v2 provider.
Inheritance
- Object
- HyperVVirtualDiskQuery
Methods
public static List<HyperVVirtualDiskInfo> Get(String computerName = null, String[] vmIdOrNamePatterns = null, Nullable<TimeSpan> timeout = null) #Returns:
List<HyperVVirtualDiskInfo>Gets Hyper-V virtual disk allocations from root\virtualization\v2.
Parameters
- computerName System.String = null
- Target computer name. Blank or . uses the local computer.
- vmIdOrNamePatterns System.String[] = null
- Optional wildcard patterns matched against VM id, disk name, instance id, and host resource path.
- timeout System.Nullable{System.TimeSpan} = null
- Optional WMI query timeout.
Returns
Virtual disk allocation rows. Returns an empty list when Hyper-V WMI is unavailable.
public static async Task<List<HyperVVirtualDiskInfo>> GetAsync(String computerName = null, String[] vmIdOrNamePatterns = null, Nullable<TimeSpan> timeout = null, CancellationToken cancellationToken = null) #Returns:
Task<List<HyperVVirtualDiskInfo>>Asynchronously gets Hyper-V virtual disk allocations from root\virtualization\v2.
Parameters
- computerName System.String = null
- Target computer name. Blank or . uses the local computer.
- vmIdOrNamePatterns System.String[] = null
- Optional wildcard patterns matched against VM id, disk name, instance id, and host resource path.
- timeout System.Nullable{System.TimeSpan} = null
- WMI query timeout.
- cancellationToken System.Threading.CancellationToken = null
- Cancellation token.
Returns
Virtual disk allocation 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