require 'facter/util/registryiis'

Facter.add(:iis_version) do
  confine kernel: :windows
  setcode do
    iis_version_string = Facter::Util::Registryiis.iis_version_string_from_registry
    # String returned on:
    # Windows 2012 R2 - "Version 8.5"
    # Windows 2008 R2 - "Version 7.5"
    # Lets gsub to get just the number
    iis_version_string.gsub(/Version\s+/, '') unless iis_version_string.nil?
  end
end

require 'facter/util/registryiis'

Facter.add(:iis_version) do
  confine :kernel => :windows
  setcode do
    iis_version_string = Facter::Util::Registryiis.iis_version_string_from_registry
    # String returned on:
    # Windows 2012 R2 - "Version 8.5"
    # Windows 2008 R2 - "Version 7.5"
    # Lets gsub to get just the number
    iis_version_string.gsub(/Version\s+/, '') unless iis_version_string.nil?
  end
end

Make the fact work on RHEL6 systems
Make the fact work on RHEL6 systems

In our combined Windows/Linux environment, running puppet 3.8.7, we got this error:

Error loading fact /var/lib/puppet/lib/facter/iis_version.rb: /var/lib/puppet/lib/facter/iis_version.rb:2: syntax error, unexpected ':', expecting kEND
  confine kernel: :windows

Using the 'former' syntax makes the fact work again.