Get-IisApplication

Gets an IIS application as an Application object.

Syntax

Get-IisApplication [-SiteName] <String> [[-VirtualPath] <String>] [<CommonParameters>]

Description

Uses the Microsoft.Web.Administration API to get an IIS application object. If the application doesn't exist, $null is returned.

The objects returned have two dynamic properties and one dynamic methods added.

Beginning with Carbon 2.0.1, this function is available only if IIS is installed.

Parameters

Name Type Description Required? Pipeline Input Default Value
SiteName String

The site where the application is running.

true false
VirtualPath String

The name of the application. Default is to return all applications running under the website $SiteName.

false false

Return Values

Microsoft.Web.Administration.Application.

EXAMPLE 1

Get-IisApplication -SiteName 'DeathStar`

Gets all the applications running under the DeathStar website.

EXAMPLE 2

Get-IisApplication -SiteName 'DeathStar' -VirtualPath '/'

Demonstrates how to get the main application for a website: use / as the application name.

EXAMPLE 3

Get-IisApplication -SiteName 'DeathStar' -VirtualPath 'MainPort/ExhaustPort'

Demonstrates how to get a nested application, i.e. gets the application at /MainPort/ExhaustPort under the DeathStar website.