Modifier

Partager via


Remove-IISConfigCollectionElement

Removes a configuration element object from an IIS configuration collection.

Syntax

Remove-IISConfigCollectionElement
      [-ConfigCollection] <ConfigurationElementCollection>
      [[-ConfigAttribute] <Hashtable>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Remove-IISConfigCollectionElement cmdlet removes a ConfigurationElement from a given Internet Information Services (IIS) ConfigurationCollection.

Examples

Example 1: Remove a file name from the list of default documents

PS C:\> $ConfigSection = Get-IISConfigSection -SectionPath "system.webServer/defaultDocument"
PS C:\> Get-IISConfigCollection $ConfigSection "Files" | Remove-IISConfigCollectionElement  -ConfigAttribute @{"Value" = "MyDefDoc.htm"}

This command removes a configuration entry from the list of default documents.

Parameters

-ConfigAttribute

Specifies a hashtable of the attributes to match while searching for the configuration elements to delete in the collection. For the configuration attributes that are not specified, no filtering will be done. If you omit this parameter, all the elements in the collection are deleted.

Type:Hashtable
Position:2
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ConfigCollection

Specifies the ConfigurationCollection from which the matching ConfigurationElements will be removed.

Type:ConfigurationElementCollection
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

ConfigurationElementCollection

Hashtable

Outputs

Object