Clear-IISConfigCollection

Clear-IISConfigCollection

Clears an IIS configuration collection.

構文

Parameter Set: Default
Clear-IISConfigCollection [-ConfigCollection] <ConfigurationElementCollection> [-InformationAction <ActionPreference> {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend} ] [-InformationVariable <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

詳細説明

The Clear-IISConfigCollection cmdlet clears a given Internet Information Services (IIS) collection by removing all the elements and putting a clear tag, which is generally <clear>. This prevents from the collection to inherit collection elements from higher levels, if any.

パラメーター

-ConfigCollection<ConfigurationElementCollection>

Specifies the ConfigurationCollection object for which the collection elements will be cleared. If a ConfigurationCollection is previously obtained and assigned to a variable, you cannot pass it to this cmdlet through the pipeline because the pipeline engine will try to enumerate, passing ConfigurationElement objects instead. Try either passing the whole Get-IISConfigCollection cmdlet into the pipeline or use it as a parameter for correct results.

Aliases

none

必須/オプション

true

位置

1

既定値

none

パイプライン入力の受け入れ

true (ByValue, ByPropertyName)

ワイルドカード文字の受け入れ

false

-InformationAction<ActionPreference>

Specifies how this cmdlet responds to an information event. The acceptable values for this parameter are:

-- SilentlyContinue
-- Stop
-- Continue
-- Inquire
-- Ignore
-- Suspend

Aliases

infa

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-InformationVariable<String>

Specifies a variable in which to store an information event message.

Aliases

iv

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-Confirm

コマンドレットを実行する前に確認メッセージを表示します。

必須/オプション

false

位置

named

既定値

false

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-WhatIf

コマンドレットが実行された場合に何が起きるのかを示します。コマンドレットは実行されません。

必須/オプション

false

位置

named

既定値

false

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

<CommonParameters>

このコマンドレットは共通のパラメーターをサポートしています(-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、および -OutVariable)。詳細については、TechNet の「 「about_CommonParameters」 (https://go.microsoft.com/fwlink/p/?LinkID=113216) を参照してください。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

  • Microsoft.Web.Administration.ConfigurationElementCollection

出力

出力型は、コマンドレットが出力するオブジェクトの型です。

使用例

Example 1: Clear the defaultDocument settings for Default Web Site, which inherits from Server level and defined in applicationHost.config.

This command adds lines in web.config which is the configuration file of Default Web Site.

PS C:\> Get-IISConfigSection -SectionPath "system.webServer/defaultDocument" -CommitPath "Default Web Site" | Get-IISConfigCollection -CollectionName "files" | Clear-IISConfigCollection -Confirm:$False

関連項目

Get-IISConfigCollection

IIS Administration Cmdlets