API Reference
Class
ServerFeatures
High-level entry point for querying installed Server Manager features (roles/role services/features) using WMI.
Inheritance
- Object
- ServerFeatures
Methods
public static List<ServerFeatureInfo> Get(String computer = null, Boolean includeAvailable = false, Nullable<TimeSpan> timeout = null, String[] namePatterns = null) #Returns:
List<ServerFeatureInfo>Gets installed server features (roles/role services/features) for the specified computer. Returns an empty list on client SKUs or when the provider is not available.
Parameters
- computer System.String = null
- Optional computer name. Defaults to local machine when null.
- includeAvailable System.Boolean = false
- When true, enriches output with Server Manager catalog data (similar to Get-WindowsFeature) so non-installed features can also be returned.
- timeout System.Nullable{System.TimeSpan} = null
- Optional command timeout for catalog enrichment.
- namePatterns System.String[] = null
- Optional wildcard patterns (`*`/`?`) used to filter on feature name fields (FeatureName, DisplayName, and Name). In installed-only mode, canonical-name filters can trigger catalog fallback matching while still returning installed entries only.
public static Task<List<ServerFeatureInfo>> GetAsync(String computer = null, Nullable<TimeSpan> timeout = null, CancellationToken ct = null, Boolean includeAvailable = false, String[] namePatterns = null) #Returns:
Task<List<ServerFeatureInfo>>Asynchronously gets installed server features (roles/role services/features) for the specified computer. Returns an empty list on client SKUs or when the provider is not available.
Parameters
- computer System.String = null
- Optional computer name. Defaults to local machine when null.
- timeout System.Nullable{System.TimeSpan} = null
- Optional timeout. Defaults to WmiDefaultTimeout.
- ct System.Threading.CancellationToken = null
- Cancellation token.
- includeAvailable System.Boolean = false
- When true, enriches output with Server Manager catalog data (similar to Get-WindowsFeature) so non-installed features can also be returned.
- namePatterns System.String[] = null
- Optional wildcard patterns (`*`/`?`) used to filter on feature name fields (FeatureName, DisplayName, and Name). In installed-only mode, canonical-name filters can trigger catalog fallback matching while still returning installed entries only.
Inherited Methods
public override Boolean Equals(Object obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object