Class: Specinfra::Command::Windows::Base::Feature

Inherits:
Specinfra::Command::Windows::Base show all
Defined in:
lib/specinfra/command/windows/base/feature.rb

Class Method Summary collapse

Methods inherited from Specinfra::Command::Windows::Base

create

Class Method Details

.check_is_enabled(name, provider) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/specinfra/command/windows/base/feature.rb', line 3

def check_is_enabled(name, provider)
  if provider.nil?
    cmd =  "@(ListWindowsFeatures -feature #{name}).count -gt 0"
  else
    cmd =  "@(ListWindowsFeatures -feature #{name} -provider #{provider.to_s}).count -gt 0"
  end

  Backend::PowerShell::Command.new do
    using 'list_windows_features.ps1'
    exec cmd
  end
end