Hi all,

Im trying to use the following in one of my receipes (using the windows cookbook):
::Chef::Recipe.send(:include, Windows::Helper)
TelnetClient_installed = is_package_installed?(‘Telnet-Client’)

For some reason it keep returing nil - am I using it right?


Just realized this is showing installed programs (from the add/remove programs), not installed windows features…
Is there an easy way to check if a windows feature is installed?

You could use powershell_out with a command similar to this (Get-WindowsFeature FeatureName).Installed

script = ‘(Get-WindowsFeature FeatureNameName).Installed’
result = powershell_out(script).stdout.chop

Result will be either the string True or False.

PERFECT! Thank you!