Get-IISConfig
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.
Required Parameters
Specifies the IIS ConfigurationSection or ConfigurationElement for which the child ConfigurationElement is returned.
Type: | ConfigurationElement |
Position: | 1 |
Default value: | None |
Accept pipeline input: | True (ByPropertyName, ByValue) |
Accept wildcard characters: | False |
Optional Parameters
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 |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Inputs
Microsoft.Web.Administration.ConfigurationElement, System.String
Outputs
Microsoft.Web.Administration.ConfigurationElement