Install-IisApplication

Creates a new application under a website.

Syntax

Install-IisApplication [-SiteName] <String> [-VirtualPath] <String> [-PhysicalPath] <String> [[-AppPoolName] <String>] [-PassThru] [<CommonParameters>]

Description

Creates a new application at VirtualPath under website SiteName running the code found on the file system under PhysicalPath, i.e. if SiteName is is example.com, the application is accessible at example.com/VirtualPath. If an application already exists at that path, it is removed first. The application can run under a custom application pool using the optional AppPoolName parameter. If no app pool is specified, the application runs under the same app pool as the website it runs under.

Beginning with Carbon 2.0, returns a Microsoft.Web.Administration.Application object for the new application if one is created or modified.

Beginning with Carbon 2.0, if no app pool name is given, existing application's are updated to use DefaultAppPool.

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 should be created.

true false
VirtualPath String

The name of the application.

true false
PhysicalPath String

The path to the application.

true false
AppPoolName String

The app pool for the application. Default is DefaultAppPool.

false false
PassThru SwitchParameter

Returns IIS application object. This switch is new in Carbon 2.0.

false false False

Return Values

Microsoft.Web.Administration.Application.

EXAMPLE 1

Install-IisApplication -SiteName Peanuts -VirtualPath CharlieBrown -PhysicalPath C:\Path\To\CharlieBrown -AppPoolName CharlieBrownPool

Creates an application at Peanuts/CharlieBrown which runs from Path/To/CharlieBrown. The application runs under the CharlieBrownPool.

EXAMPLE 2

Install-IisApplication -SiteName Peanuts -VirtualPath Snoopy -PhysicalPath C:\Path\To\Snoopy

Create an application at Peanuts/Snoopy, which runs from C:\Path\To\Snoopy. It uses the same application as the Peanuts website.