New-WebApplication

Creates a new IIS Web application.

Syntax

New-WebApplication
   [-Site <String>]
   [-Name] <String>
   [-PhysicalPath <String>]
   [-ApplicationPool <String>]
   [-Force]
   [<CommonParameters>]

Description

Creates a new IIS Web application.

Examples

-------------- EXAMPLE 1: Creating a new web application --------------

IIS:\>New-WebApplication -Name testApp -Site 'Default Web Site' -PhysicalPath c:\test -ApplicationPool DefaultAppPool

This example creates a new Web application named testApp on the Default Web Site. The application files are stored in the C:\Test folder, and the application runs in the DefaultAppPool application pool.

Required Parameters

-Name

The name of the Web application to create.

Type:String
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-ApplicationPool

The name of the application pool in which the new Web application executes.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Force

Forces the creation of the application without prompting for user confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PhysicalPath

The physical path to the Web application files.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Site

The name of the site on which the application is created.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False