私はパペットとルビーが初めてで、カスタムファクトを書き込もうとしましたが...次の問題があります
Facter.add("vsphere_installed") do
confine :operatingsystem => :windows
setcode do
if Facter::Util::Resolution.exec('c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command "Get-WmiObject -Class Win32_Product | Select-Object -DisplayName | ? {$_.DisplayName -Match "vsphere"}"') = true
result = "vSphere installed"
else
result = "false"
end
end
end
これを正確に行う方法がわかりません。インストールされているプログラムを一覧表示して検索し、true(find) の場合はインストールされていることを返します。この例は、これまでのところ false のみを返します ....