diff options
author | Adam Edwards <adamed@opscode.com> | 2014-08-29 06:13:01 -0700 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2014-09-19 12:47:35 -0700 |
commit | 5b1fc434cce3c6af044d65d898827271cf16bebb (patch) | |
tree | 169d2e6f2242a4d212baaf62829eb9d1f4139d3b /spec/support/platform_helpers.rb | |
parent | 31f0e0a53d82d4cab7b607e367dec5ec6104847c (diff) | |
download | chef-5b1fc434cce3c6af044d65d898827271cf16bebb.tar.gz |
DSC spec platform detection via WMI
Diffstat (limited to 'spec/support/platform_helpers.rb')
-rw-r--r-- | spec/support/platform_helpers.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb index 984bd12e8a..f8cad6de7f 100644 --- a/spec/support/platform_helpers.rb +++ b/spec/support/platform_helpers.rb @@ -64,6 +64,18 @@ def windows_2008r2_or_later? components.length >=2 && components[0] >= 6 && components[1] >= 1 end +def windows_powershell_dsc? + return false unless windows? + supports_dsc = false + begin + wmi = WmiLite::Wmi.new('root/microsoft/windows/desiredstateconfiguration') + lcm = wmi.query("SELECT * FROM meta_class WHERE __this ISA 'MSFT_DSCLocalConfigurationManager'") + supports_dsc = !! lcm + rescue WmiLite::WmiException + end + supports_dsc +end + def mac_osx_106? if File.exists? "/usr/bin/sw_vers" result = shell_out("/usr/bin/sw_vers") |