Skip to content

Windows Optional Feature Module

Matthew Kelly edited this page Jul 26, 2016 · 2 revisions

The Windows optional feature module will install, or uninstall, Windows optional features such as Hyper-V. You can also specify to install all of the sub-features.

Properties

Key Type Description Values
ensure string Specifies the type of operation this module will do install, uninstall
all boolean [Optional] Tells the module to also install all sub-features of the feature [Default] false
names string array List of Windows optional features to manage -

Paint

The following is an example of using the Windows optional feature type in a paint section:

{
    "paint": [
        {
            "type": "windows-optional-feature",
            "ensure": "install",
            "all": true,
            "names": [
                "Microsoft-Hyper-V"
            ]
        }
    ]
}

The above will attempt to install Hyper-V, and all of it's sub-features, onto the current machine.

Erase

The following is an example of using the Windows optional feature type in a erase section:

{
    "erase": [
        {
            "type": "windows-feature",
            "ensure": "uninstall",
            "names": [
                "Microsoft-Hyper-V"
            ]
        }
    ]
}

The above will attempt to uninstall Hyper-V from the current machine.