Edit

Share via


New-WebAppPool

Creates an IIS application pool.

Syntax

Default (Default)

New-WebAppPool
    [-Name] <String>
    [-Force]
    [<CommonParameters>]

Description

The New-WebAppPool cmdlet creates an Internet Information Services (IIS) application pool. For changing different properties of the application pool after creation, see PowerShell Snap-in: Making Configuration Changes to Websites and App Pools.

Examples

Example 1: Create an IIS application pool

IIS:\> New-WebAppPool -Name "NewAppPool"

This command creates an IIS application pool named NewAppPool.

Example 2: Create an IIS application pool and set autoStart

IIS:\> $newAppPool = New-WebAppPool -Name "NewAppPool"
IIS:\> $newAppPool.autoStart = "false"
IIS:\> $newAppPool | Set-Item

This command creates an IIS application pool named NewAppPool and sets autoStart property to false.

Example 3: Create an IIS application pool and set managedRuntimeVersion

IIS:\> New-WebAppPool -Name "NewAppPool"
IIS:\> Set-ItemProperty -Path IIS:\AppPools\NewAppPool managedRuntimeVersion "v4.0"

This command creates an IIS application pool named NewAppPool and sets managedRuntimeVersion property to v4.0.

Parameters

-Force

Forces the command to run without asking 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 IIS application pool 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

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.