Edit

Share via


Remove-IISConfigElement

Removes a specified configuration element.

Syntax

Default (Default)

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.

Parameter properties

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

Parameter sets

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

-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

-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.

Inputs

ConfigurationElement

Outputs

Object