class Chef::Resource::WindowsFeature

Public Instance Methods

run_default_subresource(desired_action) click to toggle source

call the appropriate windows_feature resource based on the specified subresource @return [void]

# File lib/chef/resource/windows_feature.rb, line 127
def run_default_subresource(desired_action)
  raise "Support for Windows feature installation via servermanagercmd.exe has been removed as this support is no longer needed in Windows 2008 R2 and above. You will need to update your recipe to install either via dism or powershell (preferred)." if new_resource.install_method == :windows_feature_servermanagercmd

  declare_resource(new_resource.install_method, new_resource.name) do
    action desired_action
    feature_name new_resource.feature_name
    source new_resource.source if new_resource.source
    all new_resource.all
    timeout new_resource.timeout
    management_tools new_resource.management_tools if new_resource.install_method == :windows_feature_powershell
  end
end