編集

次の方法で共有


Get-IISConfigElement

Gets a configuration element object from an IIS configuration section or a configuration element.

Syntax

Get-IISConfigElement
   [-ConfigElement] <ConfigurationElement>
   [[-ChildElementName] <String>]
   [<CommonParameters>]

Description

The Get-IISConfigElement cmdlet gets a child ConfigurationElement object from either a ConfigurationSection or a ConfigurationElement.

Examples

Example 1: Get a configuration element for an IIS website

PS C:\> $ConfigSection = Get-IISConfigSection -SectionPath "system.applicationHost/sites"
PS C:\> $SitesCollection = Get-IISConfigCollection -ConfigElement $ConfigSection
PS C:\> $Site = Get-IISConfigCollectionElement -ConfigCollection $SitesCollection -ConfigAttribute @{"name" = "Default Web Site"}
PS C:\> $Elem = Get-IISConfigElement -ConfigElement $Site -ChildElementName "limits"
PS C:\> Get-IISConfigAttributeValue -ConfigElement $Elem -AttributeName "MaxUrlSegments"

This command returns the configuration element limits for the Default Web Site into the Windows PowerShell variable $Elem.

Parameters

-ChildElementName

Specifies the name of the child ConfigurationElement to be returned. If this parameter is omitted, all the child elements for the given parent are returned.

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

-ConfigElement

Specifies the IIS ConfigurationSection or ConfigurationElement for which the child ConfigurationElement is returned.

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

Inputs

ConfigurationElement

String

Outputs

Object