class Inspec::Resources::WindowsHotfix

Attributes

content[RW]

Public Class Methods

new(hotfix_id = nil) click to toggle source
# File lib/inspec/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

Public Instance Methods

installed?() click to toggle source
# File lib/inspec/resources/windows_hotfix.rb, line 31
def installed?
  return false if @content.nil?

  @content.include?(@id)
end
to_s() click to toggle source
# File lib/inspec/resources/windows_hotfix.rb, line 27
def to_s
  "Windows Hotfix #{@id}"
end