Sha256: 4232d82759e1adcccf92092f2038813fd752a70b29092b40df3c870ca2c179ff

Contents?: true

Size: 1.12 KB

Versions: 13

Compression:

Stored size: 1.12 KB

Contents

---
title: About the windows_feature Resource
---

# windows_feature

Use the `windows_feature` InSpec audit resource to test features on Windows via the `Get-WindowsFeature` cmdlet.

<br>

## Syntax

A `windows_feature` resource block declares the name of the Windows feature, tests if that feature is installed, and then returns information about that feature:

    describe windows_feature('feature_name') do
      it { should be_installed }
    end

where

* `('feature_name')` must specify a Windows feature name, such as `DHCP Server` or `IIS-Webserver`
* `be_installed` is a valid matcher for this resource

<br>

## Examples

The following examples show how to use this InSpec audit resource.

### Test the DHCP Server feature

    describe windows_feature('DHCP Server') do
      it{ should be_installed }
    end

<br>

## Matchers

This InSpec audit resource has the following matchers. For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).

### be_installed

The `be_installed` matcher tests if the named Windows feature is installed:

    it { should be_installed }

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
inspec-1.51.0 docs/resources/windows_feature.md.erb
inspec-1.50.1 docs/resources/windows_feature.md.erb
inspec-1.49.2 docs/resources/windows_feature.md.erb
inspec-1.48.0 docs/resources/windows_feature.md.erb
inspec-1.47.0 docs/resources/windows_feature.md.erb
inspec-1.46.2 docs/resources/windows_feature.md.erb
inspec-1.45.13 docs/resources/windows_feature.md.erb
inspec-1.45.9 docs/resources/windows_feature.md.erb
inspec-1.44.8 docs/resources/windows_feature.md.erb
inspec-1.43.8 docs/resources/windows_feature.md.erb
inspec-1.43.5 docs/resources/windows_feature.md.erb
inspec-1.42.3 docs/resources/windows_feature.md.erb
inspec-1.41.0 docs/resources/windows_feature.md.erb