Tests a configuration section.
Test-IisConfigurationSection -SectionPath <String> [-SiteName <String>] [-VirtualPath <String>] [<CommonParameters>]
Test-IisConfigurationSection -SectionPath <String> [-SiteName <String>] [-VirtualPath <String>] -Locked [<CommonParameters>]
You can test if a configuration section exists or wheter it is locked.
Beginning with Carbon 2.0.1, this function is available only if IIS is installed.
| Name | Type | Description | Required? | Pipeline Input | Default Value |
|---|---|---|---|---|---|
| SectionPath | String | The path to the section to test. |
true | false | |
| SiteName | String | The name of the site whose configuration section to test. Optional. The default is the global configuration. |
false | false | |
| VirtualPath | String | The optional path under |
false | false | |
| Locked | SwitchParameter | Test if the configuration section is locked. |
true | false | False |
Test-IisConfigurationSection -SectionPath 'system.webServer/I/Do/Not/Exist'
Tests if a configuration section exists. Returns False, because the given configuration section doesn't exist.
Test-IisConfigurationSection -SectionPath 'system.webServer/cgi' -Locked
Returns True if the global CGI section is locked. Otherwise False.
Test-IisConfigurationSection -SectionPath 'system.webServer/security/authentication/basicAuthentication' -SiteName `Peanuts` -VirtualPath 'SopwithCamel' -Locked
Returns True if the Peanuts website's SopwithCamel sub-directory's basicAuthentication security authentication section is locked. Otherwise, returns False.