Edit

Share via


New-WebApplication

Creates an IIS web application.

Syntax

Default (Default)

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

Description

The New-WebApplication cmdlet creates an Internet Information Services (IIS) web application.

Examples

Example 1: Create a web application

IIS:\> New-WebApplication -Name "TestApp" -Site "Default Web Site" -PhysicalPath "C:\Test" -ApplicationPool "DefaultAppPool"

This command creates a web application named TestApp on the default website. The application files are stored in the C:\Test folder, and the application runs in the DefaultAppPool application pool.

Parameters

-ApplicationPool

Specifies the name of the application pool in which the new web application runs.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Force

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specifies the name of the web application to create.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PhysicalPath

Specifies the physical path to the web application files.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Site

Specifies the name of the site on which this cmdlet creates an application.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.