opscode-cookbooks/windows — pull request #101 by btm (2014-08-04 18:43:02+00:00)
Title: Switch to using the wmi-lite gem

Chef switched from ruby-wmi to wmi-lite recently, have this cookbook do the same.

This replaces #100, and I'm handing this off to @adamex to finish. I think the only work left is to think about making sure that wmi-lite is installed before the libraries need it if you're running on older versions of Chef that don't come with wmi-lite. Later we should deprecate the `windows/libraries/version.rb` in favor of `lib/chef/win32/version.rb' in chef.

I've been testing with this recipe to make sure we exercise the libraries, as the default cookbook was happily running for me with just @pieter-lazzro's patch before I did so.

```
winver = Windows::Version.new

log "server core" do
message "not on server core"
not_if { winver.server_core? }
end

hive_name = Registry.get_hive_name("HKLM")

log "hive name" do
message "HKLM is really #{hive_name}"
end

log "not media center" do
message "we are not on media center"
not_if { Registry.value_exists?(AUTO_RUN_KEY, 'Windows Media Center') }
end
```

Resulting in:
```
Recipe: win_test::default
* log[server core] action write[2014-08-04T14:35:52-04:00] INFO: Processing log[server core] action write (win_test::default line 4)
[2014-08-04T14:35:52-04:00] INFO: not on server core

* log[hive name] action write[2014-08-04T14:35:52-04:00] INFO: Processing log[hive name] action write (win_test::default line 11)
[2014-08-04T14:35:52-04:00] INFO: HKLM is really HKEY_LOCAL_MACHINE

* log[not media center] action write[2014-08-04T14:35:52-04:00] INFO: Processing log[not media center] action write (win_test::default line 15)
[2014-08-04T14:35:52-04:00] INFO: we are not on media center

```