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
Outputs
Related Links
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應