Skip to main content

windows.optionalFeature

Description

Windows optional feature resource (desktop-only)

Init

windows.optionalFeature(name string)

Fields

IDTYPEDESCRIPTION
namestringCommand ID of optional feature
displayNamestringFeature name
descriptionstringFeature description
enabledboolWhether the feature is enabled
stateintFeature installation state

Examples

Query all features containing the word PowerShell

windows.optionalfeatures.where(name == /PowerShell/)

Check that a specific Windows optional feature is not installed

windows.optionalfeatures('Hyper-V Module for Windows PowerShell').installed == false