2017-09-25 17:09:22 +00:00
|
|
|
---
|
|
|
|
title: About the windows_hotfix Resource
|
2018-02-16 00:28:15 +00:00
|
|
|
platform: windows
|
2017-09-25 17:09:22 +00:00
|
|
|
---
|
|
|
|
|
2018-01-08 18:09:13 +00:00
|
|
|
# windows_hotfix
|
|
|
|
|
2017-09-25 17:09:22 +00:00
|
|
|
Use the `windows_hotfix` InSpec audit resource to test if the hotfix has been installed on a Windows system.
|
|
|
|
|
2017-10-03 21:35:10 +00:00
|
|
|
<br>
|
|
|
|
|
2017-09-25 17:09:22 +00:00
|
|
|
## Syntax
|
|
|
|
|
|
|
|
A `windows_hotfix` resource block declares a hotfix to validate:
|
|
|
|
|
|
|
|
describe windows_hotfix('name') do
|
|
|
|
it { should be_installed }
|
|
|
|
end
|
|
|
|
|
|
|
|
where
|
|
|
|
|
|
|
|
* `('name')` must specify the name of a hotfix, such as `'KB4012213'`
|
|
|
|
* `be_installed` is a valid matcher for this resource
|
|
|
|
|
2017-10-03 21:35:10 +00:00
|
|
|
<br>
|
2017-09-25 17:09:22 +00:00
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
The following examples show how to use this InSpec audit resource.
|
|
|
|
|
|
|
|
### Test if KB4012213 is installed
|
|
|
|
|
|
|
|
describe windows_hotfix('KB4012213') do
|
|
|
|
it { should be_installed }
|
|
|
|
end
|
|
|
|
|
|
|
|
### Test that a hotfix is not installed
|
|
|
|
|
|
|
|
describe windows_hotfix('KB9999999') do
|
|
|
|
it { should_not be_installed }
|
|
|
|
end
|
2017-10-03 21:35:10 +00:00
|
|
|
|
|
|
|
<br>
|
|
|
|
|
|
|
|
## Matchers
|
|
|
|
|
2018-02-16 03:07:18 +00:00
|
|
|
For a full list of available matchers, please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
2017-10-03 21:35:10 +00:00
|
|
|
|
|
|
|
### be_installed
|
|
|
|
|
|
|
|
The `be_installed` matcher tests if the named hotfix is installed on the system:
|
|
|
|
|
|
|
|
it { should be_installed }
|