Table of contents
TLS
TOC
Collapse the table of content
Expand the table of content

Get-IISConfigElement

Brian Lich|Last Updated: 3/30/2017

SYNOPSIS

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
Parameter Sets: (All)
Aliases: 

Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-ConfigElement

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

Type: ConfigurationElement
Parameter Sets: (All)
Aliases: 

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

Microsoft.Web.Administration.ConfigurationElement, System.String

OUTPUTS

Microsoft.Web.Administration.ConfigurationElement

NOTES

Remove-IISConfigElement

IIS Administration Cmdlets for Windows PowerShell

© 2017 Microsoft