Created
July 18, 2013 19:34
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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