Edit

Share via


Set-WebHandler

Configures an IIS request handler.

Syntax

Default (Default)

Set-WebHandler
    [-Name] <String>
    [-Path <String>]
    [-Verb <String>]
    [-Type <String>]
    [-Modules <String>]
    [-ScriptProcessor <String>]
    [-Precondition <String>]
    [-ResourceType <String>]
    [-RequiredAccess <String>]
    [-Location <String[]>]
    [[-PSPath] <String[]>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Set-WebHandler cmdlet configures an Internet Information Services (IIS) request handler.

Examples

Example 1: Change a property of a handler

IIS:\> Set-WebHandler -Name "StaticFile" -Path "*.htm"

This command sets properties of a handler.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

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 location in which to set this configuration.

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 needed for the handler. This parameter applies to native handlers 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

-Name

Specifies the name of the handler to configure.

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:False
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 to the location in which the module is configured.

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 access user rights that are required for the module. 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 required for the handler.

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 to run for the handler. This parameter applies to native handlers 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

-Type

Specifies the managed type of the handler. This parameter applies to managed handlers 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 for which the handler 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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
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.