inspec/docs/resources/windows_feature.md.erb

48 lines
1.1 KiB
Text
Raw Normal View History

2016-09-22 12:43:57 +00:00
---
title: About the windows_feature Resource
platform: windows
2016-09-22 12:43:57 +00:00
---
# windows_feature
Use the `windows_feature` InSpec audit resource to test features on Windows via the `Get-WindowsFeature` cmdlet.
<br>
## Syntax
2016-09-22 12:43:57 +00:00
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>
2016-09-22 12:43:57 +00:00
## Examples
2016-09-22 12:43:57 +00:00
The following examples show how to use this InSpec audit resource.
### Test the DHCP Server feature
2016-09-22 12:43:57 +00:00
describe windows_feature('DHCP Server') do
it{ should be_installed }
end
<br>
## 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 }