--
Facter.add("is_vm") do confine :osfamily => "windows" setcode do powershell = 'C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -NoProfile' command = '$(Get-WMIObject Win32_ComputerSystem -Property Model).Model | %{if ( ($_ -eq \"Virtual Machine\") -or ($_ -eq \"OpenStack Nova\") ){return $true}else{return $false}}' Facter::Core::Execution.execute(%Q{#{powershell} -command "#{command}"}) end end
--