New-WebApplication
New-WebApplication
Creates a new IIS Web application.
Syntax
New-WebApplication [-Site <String>] [-Name] <String> [-PhysicalPath <String>] [-ApplicationPool <String>] [-Force] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [<CommonParameters>]
Detailed Description
Creates a new IIS Web application.
Parameters
-Site <String>
The name of the site on which the application is created.
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
true (ByPropertyName) |
Position? |
named |
-Name <String>
The name of the Web application to create.
Attributes
Name | Value |
---|---|
Required? |
true |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
true (ByPropertyName) |
Position? |
1 |
-PhysicalPath <String>
The physical path to the Web application files.
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
true (ByPropertyName) |
Position? |
named |
-ApplicationPool <String>
The name of the application pool in which the new Web application executes.
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
true (ByPropertyName) |
Position? |
named |
-Force <SwitchParameter>
Forces the creation of the application without prompting for user confirmation.
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
false |
Position? |
named |
-WarningAction <ActionPreference>
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
false |
Position? |
named |
-WarningVariable <String>
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
false |
Position? |
named |
-CommonParameter
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see About Common Parameter
Input and Return Types
The input type is the type of the objects that you can pipe to the cmdlet. The return type is the type of the objects that the cmdlet emits.
Input Type |
. |
Return Type |
. |
Notes
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.