serverspec/serverspec — pull request #343 by elmundio87 (2014-02-05 13:43:25+00:00)
Title: Windows feature: Search using different providers

Windows features can be installed/searched for using 2 different mechanisms in windows - DISM.exe and the ServerManager powershell module.

I've updated the resource with support for both, as both methods list the same windows features with different names.

For example;

Name in Windows: Internet Information Services
Name in DISM: IIS-Webserver
Name in Powershell: Web-Webserver

Depending on which method you used to install the features in the first place, you're going to want to test for the feature using the same method.

I've set DISM.exe as the default provider, as the Powershell method only works on Windows Server 2008+12. DISM.exe works on Windows 7 as well as 2008+12.

You choose the provider using the following syntax

````
describe windows_feature('Minesweeper') do
it{ should be_installed } #Defaults to "dism"
it{ should be_installed.by("dism") }
it{ should be_installed.by("powershell") }
end
````