Sha256: aef73a6753b9f3c37feaa73aae5a8b8f803d63042085f17e6aaf4c91b17d6e04

Contents?: true

Size: 967 Bytes

Versions: 234

Compression:

Stored size: 967 Bytes

Contents

class Specinfra::Command::Windows::Base::Service < Specinfra::Command::Windows::Base
  class << self
    def check_is_installed(service)
      Backend::PowerShell::Command.new do
        using 'find_service.ps1'
        exec "@(FindService -name '#{service}').count -gt 0"
      end
    end

    def check_has_start_mode(service, mode)
      Backend::PowerShell::Command.new do
        using 'find_service.ps1'
        exec  "'#{mode}' -match (FindService -name '#{service}').StartMode -and (FindService -name '#{service}') -ne $null"
      end
    end

    def check_is_enabled(service, level=nil)
      Backend::PowerShell::Command.new do
        using 'find_service.ps1'
        exec "(FindService -name '#{service}').StartMode -eq 'Auto'"
      end
    end

    def check_is_running(service)
      Backend::PowerShell::Command.new do
        using 'find_service.ps1'
        exec "(FindService -name '#{service}').State -eq 'Running'"
      end
    end
  end
end

Version data entries

234 entries across 234 versions & 3 rubygems

Version Path
specinfra-rb19-2.44.7 lib/specinfra/command/windows/base/service.rb
specinfra-cisco-2.41.0 lib/specinfra/command/windows/base/service.rb
specinfra-2.51.1 lib/specinfra/command/windows/base/service.rb
specinfra-2.51.0 lib/specinfra/command/windows/base/service.rb
specinfra-2.50.4 lib/specinfra/command/windows/base/service.rb
specinfra-2.50.3 lib/specinfra/command/windows/base/service.rb
specinfra-2.50.2 lib/specinfra/command/windows/base/service.rb
specinfra-2.50.1 lib/specinfra/command/windows/base/service.rb
specinfra-2.50.0 lib/specinfra/command/windows/base/service.rb
specinfra-2.49.0 lib/specinfra/command/windows/base/service.rb
specinfra-2.48.0 lib/specinfra/command/windows/base/service.rb
specinfra-2.47.1 lib/specinfra/command/windows/base/service.rb
specinfra-2.47.0 lib/specinfra/command/windows/base/service.rb
specinfra-2.46.0 lib/specinfra/command/windows/base/service.rb
specinfra-2.45.0 lib/specinfra/command/windows/base/service.rb
specinfra-2.44.8 lib/specinfra/command/windows/base/service.rb
specinfra-2.44.7 lib/specinfra/command/windows/base/service.rb
specinfra-2.44.6 lib/specinfra/command/windows/base/service.rb
specinfra-2.44.5 lib/specinfra/command/windows/base/service.rb
specinfra-2.44.4 lib/specinfra/command/windows/base/service.rb