Method: Inspec::Resources::WindowsHotfix#initialize
- Defined in:
- lib/resources/windows_hotfix.rb
#initialize(hotfix_id = nil) ⇒ WindowsHotfix
Returns a new instance of WindowsHotfix.
16 17 18 19 20 21 22 23 24 |
# File 'lib/resources/windows_hotfix.rb', line 16 def initialize(hotfix_id = nil) @id = hotfix_id.upcase @content = nil os = inspec.os return skip_resource 'The `windows_hotfix` resource is not a feature of your OS.' unless os.windows? query = "get-hotfix -id #{@id}" cmd = inspec.powershell(query) @content = cmd.stdout end |