Get-IISConfigSection
업데이트 날짜: 2015년 8월
Get-IISConfigSection
Gets a configuration section object to work further with the IIS Configuration Store.
구문
Parameter Set: Default
Get-IISConfigSection [[-SectionPath] <String> ] [[-CommitPath] <String> ] [[-Location] <String> ] [-InformationAction <ActionPreference> {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend} ] [-InformationVariable <String> ] [ <CommonParameters>]
자세한 설명
The Get-IISConfigSection cmdlet gets a configuration section (Microsoft.Web.Administration.ConfigurationSection) object to work further with the Internet Information Services (IIS) Configuration Store. It is generally the first cmdlet to use if configuration is to be read or updated. The output of this cmdlet can be passed to other cmdlets in the pipeline where ConfigurationElement objects are expected, since ConfigurationSection inherits from ConfigurationElement.
If the SectionPath parameter is not used, the cmdlet lists all the available sections. The sections that can be used are either defined in the applicationHost.config (IIS Configuration) or root web.config (.NET Framework).
매개 변수
-CommitPath<String>
Specifies the path where the configuration will be retrieved from. If CommitPath is omitted, applicationHost.config or root .NET configuration (root web.config) will be used.
별칭 |
none |
필수 여부 |
false |
위치 |
2 |
기본값 |
none |
파이프라인 입력 허용 여부 |
true(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
별칭 |
infa |
필수 여부 |
false |
위치 |
named |
기본값 |
none |
파이프라인 입력 허용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-InformationVariable<String>
Specifies a variable in which to store an information event message.
별칭 |
iv |
필수 여부 |
false |
위치 |
named |
기본값 |
none |
파이프라인 입력 허용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-Location<String>
Specifies the name of the IIS configuration location for which a configuration object is returned. This corresponds to the <location> tag in configuration files.
별칭 |
none |
필수 여부 |
false |
위치 |
3 |
기본값 |
none |
파이프라인 입력 허용 여부 |
true(ByPropertyName) |
와일드카드 문자 허용 여부 |
false |
-SectionPath<String>
Specifies the name of the IIS configuration section for which a configuration object is returned.
별칭 |
none |
필수 여부 |
false |
위치 |
1 |
기본값 |
none |
파이프라인 입력 허용 여부 |
true(ByValue,ByPropertyName) |
와일드카드 문자 허용 여부 |
false |
<CommonParameters>
이 cmdlet은 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable 등의 일반 매개 변수를 지원합니다. 자세한 내용은 TechNet의 about_CommonParameters(https://go.microsoft.com/fwlink/p/?LinkID=113216)
입력
입력 형식은 cmdlet으로 파이프할 수 있는 개체의 형식입니다.
- string, string[]
출력
출력 형식은 cmdlet 실행 시 출력되는 개체의 형식입니다.
- Microsoft.Web.Administration.ConfigurationSection, Microsoft.Web.Administration.ConfigurationSection[]
예
Example 1: Get a configuration section object for a section path
This command gets the configuration section object for the system.applicationHost/sites section.
PS C:\> $ConfigSection = Get-IISConfigSection -SectionPath "system.applicationHost/sites"
Example 2: Get process state information for an IIS website
This command gets runtime state information for the Default Web Site.
PS C:\> $ConfigSection = Get-IISConfigSection -SectionPath "system.applicationHost/sites"
Get-IISConfigCollection $configSection | Get-IISConfigCollectionElement -ConfigAttribute @{"Name"="Default Web Site"} | Get-IISConfigAttributeValue -AttributeName "State"
Example 3: Add a new default document at the global configuration level
This command adds filename MyDefDoc.htm to the <files> collection of the <defaultDocument> section of the applicationHost.config file.
PS C:\> Get-IISConfigSection -SectionPath "system.webServer/defaultDocument" | Get-IISConfigCollection -CollectionName "files" | New-IISConfigCollectionElement -ConfigAttribute @{"Value" = "MyDefDoc.htm"}
Example 4: Create an application pool
This command creates an application pool and stores the result in variable $ConfigSectionCollection.
PS C:\> Start-IISCommitDelay
PS C:\> $ConfigSectionCollection = Get-IISConfigSection –SectionPath "system.applicationHost/applicationPools" | Get-IISConfigCollection
PS C:\> New-IISConfigCollectionElement -ConfigCollection $configSectionCollection -ConfigAttribute @{Name = "MyNewSiteAppPool"; autoStart=$true; managedPipelineMode="Integrated" }
PS C:\> Stop-IISCommitDelay