Edit

Share via


New-WebHandler

Creates an IIS request handler.

Syntax

Default (Default)

New-WebHandler
    [-Name] <String>
    -Path <String>
    -Verb <String>
    [-Type <String>]
    [-Modules <String>]
    [-ScriptProcessor <String>]
    [-Precondition <String>]
    [-ResourceType <String>]
    [-RequiredAccess <String>]
    [-Force]
    [-Location <String[]>]
    [[-PSPath] <String[]>]
    [<CommonParameters>]

Description

The New-WebHandler cmdlet creates an Internet Information Services (IIS) request handler.

Examples

Example 1: Add a new handler

IIS:\> New-WebHandler -Name "TestHandler" -Path "*.test" -Verb "GET,POST" -Modules "IsapiModule" -PSPath "IIS:\sites\Default Web Site"

This command adds a handler named TestHandler to the default website.

Parameters

-Force

Forces the creation of the new handler.

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

-Location

Specifies the configuration location in which the handler is configured.

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

-Modules

Specifies the modules used for the handler.

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

-Name

Specifies the name of the new request handler.

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

-Path

Specifies the physical path to the handler. This parameter applies to native modules only.

Parameter properties

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

Parameter sets

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

-Precondition

Specifies preconditions for the new handler.

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

-PSPath

Specifies an IIS configuration path.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-RequiredAccess

Specifies the user rights that are required for the new handler. The acceptable values for this parameter are:

  • Read
  • Write
  • Execute
  • Script

Parameter properties

Type:String
Default value:None
Accepted values:None, Read, Write, Script, Execute
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

-ResourceType

Specifies the resource type this handler runs.

Parameter properties

Type:String
Default value:None
Accepted values:File, Directory, Either, Unspecified
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

-ScriptProcessor

Specifies the script processor that runs for the module.

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

-Type

Specifies the managed type of the new module. This parameter applies to managed modules only.

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

-Verb

Specifies the HTTP verbs that are handled by the new handler.

Parameter properties

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

Parameter sets

(All)
Position:Named
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.