Modifier

Partager via


Remove-IISConfigElement

Removes a specified configuration element.

Syntax

Remove-IISConfigElement
      [-ConfigElement] <ConfigurationElement>
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Remove-IISConfigElement cmdlet deletes a specified configuration element. This affectively causes that configuration element to inherit from the parents, if any, or use the default value as described in the schema. If the configuration element that is being removed is a collection element, it is removed from the collection, in which case the functionality is equivalent to Remove-IISConfigCollectionElement.

Examples

Example 1: Remove a configuration element from an IIS website

PS C:\> Get-IISConfigSection "system.webServer/defaultDocument" -CommitPath "Default Web Site" | Remove-IISConfigElement

This command removes a configuration section from a web configuration contained in IIS website Default Web Site.

Parameters

-ConfigElement

Specifies the Internet Information Services (IIS) ConfigurationSection or ConfigurationElement to be deleted.

Type:ConfigurationElement
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

ConfigurationElement

Outputs

Object