Sha256: 50858664ae37d102b01b0066cc5b3e7778b7eaefdbed8322830da7cc6b9b99ea

Contents?: true

Size: 1.65 KB

Versions: 27

Compression:

Stored size: 1.65 KB

Contents

function FindIISWebsite 
{
    param($name)

    Import-Module WebAdministration

    Try {
        Get-Item "IIS:\Sites\$name" -Erroraction silentlycontinue
    }
    Catch [System.IO.FileNotFoundException] {
        Get-Item "IIS:\Sites\$name" -Erroraction silentlycontinue
    }
}

function FindIISAppPool
{
    param($name)
    
    Import-Module WebAdministration
    
    Get-Item "IIS:\AppPools\$name" -Erroraction silentlycontinue
}

function FindSiteBindings
{
    param($name, $protocol, $hostHeader, $port, $ipAddress)

    Import-Module WebAdministration

    Get-WebBinding -Name $name -Protocol $protocol -HostHeader $hostHeader -Port $port -IPAddress $ipAddress
}

function FindSiteVirtualDir
{
    param($name, $vdir, $path)

    Import-Module WebAdministration

    $webVirtDirPath = [string]::Format('IIS:\Sites\{0}\{1}',$name, $vdir);
    if (Test-Path $webVirtDirPath)
    {
        if ([string]::IsNullOrEmpty($path))
        {
            $true
        }
        else
        {
            (Get-Item $webVirtDirPath).physicalPath -eq $path
        }
    }
    else
    {
        $false
    }
}

function FindSiteApplication
{
    param($name, $app, $pool, $physicalPath)

    Import-Module WebAdministration

    $path = "IIS:\Sites\${name}\${app}"
    $result = $false
    if (Test-Path $path)
    {
        $result = $true
        if ([string]::IsNullOrEmpty($pool) -eq $false)
        {
            $result = $result -and (Get-Item $path).applicationPool -eq $pool
        }

        if ([string]::IsNullOrEmpty($physicalPath) -eq $false)
        {
            $result = $result -and (Get-Item $path).physicalPath -eq $physicalPath
        }
    }

    $result
}

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
specinfra-2.0.0.beta50 lib/specinfra/backend/powershell/support/find_iis_component.ps1
specinfra-2.0.0.beta49 lib/specinfra/backend/powershell/support/find_iis_component.ps1
specinfra-2.0.0.beta48 lib/specinfra/backend/powershell/support/find_iis_component.ps1
specinfra-2.0.0.beta47 lib/specinfra/backend/powershell/support/find_iis_component.ps1
specinfra-2.0.0.beta46 lib/specinfra/backend/powershell/support/find_iis_component.ps1
specinfra-2.0.0.beta45 lib/specinfra/backend/powershell/support/find_iis_component.ps1
specinfra-2.0.0.beta44 lib/specinfra/backend/powershell/support/find_iis_component.ps1
specinfra-2.0.0.beta43 lib/specinfra/backend/powershell/support/find_iis_component.ps1
specinfra-2.0.0.beta42 lib/specinfra/backend/powershell/support/find_iis_component.ps1
specinfra-2.0.0.beta41 lib/specinfra/backend/powershell/support/find_iis_component.ps1
specinfra-2.0.0.beta40 lib/specinfra/backend/powershell/support/find_iis_component.ps1
specinfra-2.0.0.beta39 lib/specinfra/backend/powershell/support/find_iis_component.ps1
specinfra-2.0.0.beta38 lib/specinfra/backend/powershell/support/find_iis_component.ps1
specinfra-2.0.0.beta37 lib/specinfra/backend/powershell/support/find_iis_component.ps1
specinfra-2.0.0.beta36 lib/specinfra/backend/powershell/support/find_iis_component.ps1
specinfra-2.0.0.beta35 lib/specinfra/backend/powershell/support/find_iis_component.ps1
specinfra-2.0.0.beta34 lib/specinfra/backend/powershell/support/find_iis_component.ps1
specinfra-2.0.0.beta33 lib/specinfra/backend/powershell/support/find_iis_component.ps1
specinfra-2.0.0.beta32 lib/specinfra/backend/powershell/support/find_iis_component.ps1
specinfra-2.0.0.beta31 lib/specinfra/backend/powershell/support/find_iis_component.ps1