Remove-WebConfigurationLocation

Removes an IIS configuration location.

Syntax

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

Description

Removes an IIS configuration location.

Examples

-------------- EXAMPLE 1: Add and remove 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.

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-Name

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

Type:String
Position:2
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-PSPath

An IIS configuration path.

Type:String[]
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Recurse

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

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

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

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False