Sha256: 2fef8567a1e48d7338c9f705af4a7d5e80e87cf5d2daa34a2a5c0dabc8979065

Contents?: true

Size: 1.9 KB

Versions: 2

Compression:

Stored size: 1.9 KB

Contents

class Specinfra::Command::Windows::Base::IisAppPool < Specinfra::Command::Windows::Base
  class << self
    def check_exists(name)
      Backend::PowerShell::Command.new do
        using 'find_iis_component.ps1'
        exec "@(FindIISAppPool -name '#{name}').count -gt 0"
      end
    end

    def check_has_dotnet_version(name, dotnet)
      Backend::PowerShell::Command.new do
        using 'find_iis_component.ps1'
        exec "(FindIISAppPool -name '#{name}').managedRuntimeVersion -match 'v#{dotnet}'"
      end
    end

    def check_has_32bit_enabled(name)
      Backend::PowerShell::Command.new do
        using 'find_iis_component.ps1'
        exec "(FindIISAppPool -name '#{name}').enable32BitAppOnWin64 -eq $true"
      end
    end

    def check_has_idle_timeout(name, minutes)
      Backend::PowerShell::Command.new do
        using 'find_iis_component.ps1'
        exec "(FindIISAppPool -name '#{name}').processModel.idleTimeout.Minutes -eq #{minutes}"
      end
    end

    def check_has_identity_type(name, type)
      Backend::PowerShell::Command.new do
        using 'find_iis_component.ps1'
        exec "(FindIISAppPool -name '#{name}').processModel.identityType -eq '#{type}'"
      end
    end

    def check_has_user_profile(name)
      Backend::PowerShell::Command.new do
        using 'find_iis_component.ps1'
        exec "(FindIISAppPool -name '#{name}').processModel.loadUserProfile -eq $true"
      end
    end

    def check_has_username(name, username)
      Backend::PowerShell::Command.new do
        using 'find_iis_component.ps1'
        exec "(FindIISAppPool -name '#{name}').processModel.username -eq '#{username}'"
      end
    end

    def check_has_periodic_restart(name, minutes)
      Backend::PowerShell::Command.new do
        using 'find_iis_component.ps1'
        exec "(FindIISAppPool -name '#{name}').recycling.periodicRestart.time.TotalMinutes -eq #{minutes}"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
specinfra-2.0.0.beta23 lib/specinfra/command/windows/base/iis_app_pool.rb
specinfra-2.0.0.beta22 lib/specinfra/command/windows/base/iis_app_pool.rb