Skip to content

Instantly share code, notes, and snippets.

@adamgoucher
Created July 18, 2013 19:34
Show Gist options
  • Select an option

  • Save adamgoucher/6032310 to your computer and use it in GitHub Desktop.

Select an option

Save adamgoucher/6032310 to your computer and use it in GitHub Desktop.
A Puppet 'Fact' which returns a comma separated list of hotfixes installed on a windows machine.
require 'facter'
Facter.add(:hotfixes) do
confine :operatingsystem => :windows
setcode do
require 'facter/util/wmi'
fixes = []
wmi = Facter::Util::WMI.connect()
wmi.ExecQuery("select HotFixID from win32_quickfixengineering").each do |hotfix|
fixes.push(hotfix.HotFixID)
end
fixes.sort.join(',')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment