--
Facter.add("hmail") do confine :osfamily => "windows" setcode do powershell = 'C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -NoProfile' command = ' if (get-service hMailServer -ea SilentlyContinue){return $true}else{return $false}' Facter::Core::Execution.execute(%Q{#{powershell} -command "#{command}"}) end end
--