Share via


Remove-WebConfigurationLocation

Remove-WebConfigurationLocation

Removes an IIS configuration location.

Syntax

Remove-WebConfigurationLocation [[-Name] <String>] [-Recurse] [[-PSPath] <String[]>] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [-WhatIf] [-Confirm] [<CommonParameters>]

Detailed Description

Removes an IIS configuration location.

Parameters

-Name <String>

The name of the configuration location that is to be removed.

Attributes

Name Value

Required?

false

Accept wildcard characters?

false

Accept Pipeline Input?

true (ByPropertyName)

Position?

3

-Recurse <SwitchParameter>

When the Recurse parameter is used, it specifies that locations within the hierarchy of the specified location are also removed.

Attributes

Name Value

Required?

false

Accept wildcard characters?

false

Accept Pipeline Input?

false

Position?

named

-PSPath <String[]>

An IIS configuration path.

Attributes

Name Value

Required?

false

Accept wildcard characters?

false

Accept Pipeline Input?

true (ByPropertyName)

Position?

2

-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

-WhatIf <SwitchParameter>

Describes what would happen if you executed the command without actually executing the command.

Attributes

Name Value

Required?

false

Accept wildcard characters?

false

Accept Pipeline Input?

false

Position?

named

-Confirm <SwitchParameter>

Prompts for confirmation before executing the command.

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: Adding and removing a configuration location

IIS:\>Set-WebConfigurationProperty -PSPath "IIS:\" -Filter //windowsAuthentication -Location "Default Web Site/mypage.htm" -Name enabled -Value true 
Get-WebConfigurationLocation -Name "Default Web Site" -PSPath "IIS:\" 
"Sleep 5 seconds before removing the configuration location"; Sleep 5 
Remove-WebConfigurationLocation -Name "Default Web Site/my*" 
Get-WebConfigurationLocation -Name "Default Web Site" -PSPath "IIS:\"

This example adds, and then removes, a configuration location.