Skip to content

Latest commit

 

History

History
101 lines (72 loc) · 3.58 KB

Get-IISConfigCollectionElement.md

File metadata and controls

101 lines (72 loc) · 3.58 KB
description external help file Module Name ms.date online version schema title
Use this topic to help manage Windows and Windows Server technologies with Windows PowerShell.
Microsoft.IIS.Powershell.Commands.dll-Help.xml
IISAdministration
12/20/2016
2.0.0
Get-IISConfigCollectionElement

Get-IISConfigCollectionElement

SYNOPSIS

Gets a configuration element object from an IIS configuration collection.

SYNTAX

Get-IISConfigCollectionElement [-ConfigCollection] <ConfigurationElementCollection>
 [[-ConfigAttribute] <Hashtable>] [<CommonParameters>]

DESCRIPTION

The Get-IISConfigCollectionElement cmdlet gets a ConfigurationElement object that is part of a given ConfigurationCollection. The returned element then can be used in further cmdlets that expect a ConfigurationElement.

EXAMPLES

Example 1: Get a configuration element for the default web site by passing the collection through a pipeline

PS C:\> Get-IISConfigSection -SectionPath "system.applicationHost/sites" | Get-IISConfigCollection | Get-IISConfigCollectionElement -ConfigAttribute @{"name"="Default Web Site"}

This command gets a configuration element for the default web site by passing the collection through a pipeline.

Example 2: Get a configuration element using a configuration collection as a parameter

PS C:\> $SiteCollection = Get-IISConfigSection -SectionPath "system.applicationHost/sites" | Get-IISConfigCollection
Get-IISConfigCollectionElement -ConfigCollection $SiteCollection -ConfigAttribute @{"name"="Default Web Site"}

This command gets a configuration element for the default web site and then stores the element into variable $SiteCollection.

PARAMETERS

-ConfigAttribute

Specifies a hashtable of the attributes for the configuration element to be inserted. The cmdlet will fail if any required attributes are omitted from this table.

Type: Hashtable
Parameter Sets: (All)
Aliases: 

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

-ConfigCollection

Specifies the ConfigurationCollection object for which the collection elements will be returned. 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.

Type: ConfigurationElementCollection
Parameter Sets: (All)
Aliases: 

Required: True
Position: 1
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 (http://go.microsoft.com/fwlink/?LinkID=113216).

INPUTS

Microsoft.Web.Administration.ConfigurationElementCollection

System.Collections.Hashtable

OUTPUTS

System.Object

NOTES

RELATED LINKS

New-IISConfigCollectionElement

Remove-IISConfigCollectionElement

IIS Administration Cmdlets for Windows PowerShell