API Reference
Interface
IWmiClient
Abstraction over WMI/CIM queries used by inventory and policy readers.
Methods
Query 2 overloads
public abstract IReadOnlyList<WmiRow> Query(String computer, String namespace, String query, WmiOptions options, CancellationToken ct = null) #Returns:
IReadOnlyList<WmiRow>Runs a WMI query and returns rows as a lightweight collection.
Parameters
- computer System.String
- namespace System.String
- query System.String
- timeout System.Nullable{System.TimeSpan} = null
- ct System.Threading.CancellationToken = null
Query(System.String computer, System.String namespace, System.String query, ComputerX.Wmi.WmiOptions options, System.Threading.CancellationToken ct) #Runs a WMI query with explicit options (credentials/preferences/timeout).
Parameters
- computer System.String
- namespace System.String
- query System.String
- options ComputerX.Wmi.WmiOptions
- ct System.Threading.CancellationToken
QueryAsync 2 overloads
public abstract Task<IReadOnlyList<WmiRow>> QueryAsync(String computer, String namespace, String query, WmiOptions options, CancellationToken ct = null) #Returns:
Task<IReadOnlyList<WmiRow>>Runs a WMI query and returns rows as a lightweight collection.
Parameters
- computer System.String
- namespace System.String
- query System.String
- timeout System.Nullable{System.TimeSpan} = null
- ct System.Threading.CancellationToken = null
QueryAsync(System.String computer, System.String namespace, System.String query, ComputerX.Wmi.WmiOptions options, System.Threading.CancellationToken ct) #Runs a WMI query with explicit options (credentials/preferences/timeout).
Parameters
- computer System.String
- namespace System.String
- query System.String
- options ComputerX.Wmi.WmiOptions
- ct System.Threading.CancellationToken
public abstract T QuerySingle<T>(String computer, String namespace, String query, Func<WmiRow, T> projector, WmiOptions options, CancellationToken ct = null) #Returns:
TType Parameters
- T
Parameters
- computer String
- namespace String
- query String
- projector Func<WmiRow, T>
- timeout Nullable<TimeSpan> = null
- ct CancellationToken = null
public abstract Task<T> QuerySingleAsync<T>(String computer, String namespace, String query, Func<WmiRow, T> projector, WmiOptions options, CancellationToken ct = null) #Returns:
Task<T>Type Parameters
- T
Parameters
- computer String
- namespace String
- query String
- projector Func<WmiRow, T>
- timeout Nullable<TimeSpan> = null
- ct CancellationToken = null
QuerySingleAsync``1 2 overloads
QuerySingleAsync``1(System.String computer, System.String namespace, System.String query, System.Func{ComputerX.Wmi.WmiRow,``0} projector, System.Nullable{System.TimeSpan} timeout, System.Threading.CancellationToken ct) #Runs a WMI query and returns the first row projected to a value.
Parameters
- computer System.String
- namespace System.String
- query System.String
- projector System.Func{ComputerX.Wmi.WmiRow,``0}
- timeout System.Nullable{System.TimeSpan}
- ct System.Threading.CancellationToken
QuerySingleAsync``1(System.String computer, System.String namespace, System.String query, System.Func{ComputerX.Wmi.WmiRow,``0} projector, ComputerX.Wmi.WmiOptions options, System.Threading.CancellationToken ct) #Runs a WMI query with options and returns the first row projected.
Parameters
- computer System.String
- namespace System.String
- query System.String
- projector System.Func{ComputerX.Wmi.WmiRow,``0}
- options ComputerX.Wmi.WmiOptions
- ct System.Threading.CancellationToken
QuerySingle``1 2 overloads
QuerySingle``1(System.String computer, System.String namespace, System.String query, System.Func{ComputerX.Wmi.WmiRow,``0} projector, System.Nullable{System.TimeSpan} timeout, System.Threading.CancellationToken ct) #Runs a WMI query and returns the first row projected to a value.
Parameters
- computer System.String
- namespace System.String
- query System.String
- projector System.Func{ComputerX.Wmi.WmiRow,``0}
- timeout System.Nullable{System.TimeSpan}
- ct System.Threading.CancellationToken
QuerySingle``1(System.String computer, System.String namespace, System.String query, System.Func{ComputerX.Wmi.WmiRow,``0} projector, ComputerX.Wmi.WmiOptions options, System.Threading.CancellationToken ct) #Runs a WMI query with options and returns the first row projected.
Parameters
- computer System.String
- namespace System.String
- query System.String
- projector System.Func{ComputerX.Wmi.WmiRow,``0}
- options ComputerX.Wmi.WmiOptions
- ct System.Threading.CancellationToken