powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Get-WebConfigurationProperty



NAME
Get-WebConfigurationProperty

SYNOPSIS
Gets an IIS configuration property at the specified path.

SYNTAX
Get-WebConfigurationProperty -Name [-Recurse] [-Location ] [-Filter] [[-PSPath] ring[]>] [-WarningAction ] [-WarningVariable ] []


DESCRIPTION
Get-WebConfigurationProperty is very similar to Get-Configuration. Get-WebConfigurationProperty supports globbing (
wildcards) however.


PARAMETERS
-Name
The name of the property to get.

Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Recurse
Returns the properties of nodes contained within the specified node hierarchy when -Recurse is specified.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Location
The location of the configuration setting. Location tags are usually used for configuration settings that need
to be more granular than per application or per virtual directory. Settings for particular files or directory a
re an example.

Required? false
Position? named
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-Filter
Specifies the IIS configuration section or an XPath query that returns a configuration element.

Required? true
Position? 1
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-PSPath
Specifies the configuration path. This can be either an IIS configuration path (e.g. machine/webroot/apphost) o
r the IIS module path (e.g. 'IIS:\sites\Default Web Site').

Required? false
Position? 2
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-WarningAction


Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-WarningVariable


Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS
PSObject


OUTPUTS
PSObject


NOTES




-------------- EXAMPLE 1: Return the Default Documents for the Default Web Site --------------

C:\PS>Get-WebConfigurationProperty -Filter //defaultDocument/files/add -PSPath 'IIS:\Sites\Default Web Site' -Name
value | select value


Returns a list of the Default documents associated with the Default Web Site.


Default.htm
Default.asp
index.htm
index.html
iisstart.htm
default.aspx


-------------- EXAMPLE 2: Show handlers mapped to ASPNET_ISAPI.DLL --------------

C:\PS>Get-WebConfigurationProperty //handlers 'IIS:\sites\Default Web Site' -Property Collection[scriptProcessor="*
aspnet_isapi.dll"] | select path,name


Demonstrates how to get the handlers mapped to aspnet_isapi.dll.





-------------- EXAMPLE 3: List default documents using globbing --------------

C:\PS>Get-WebConfigurationProperty -Filter //defaultDocument/files -PSPath 'IIS:\Sites\Default Web Site' -Property
Collection[value="index*"]


This command returns all Default Documents that start with the string 'index'. The example uses globbing (wildcard
expansion) to achieve this.






RELATED LINKS
Get-WebConfiguration
Set-WebConfigrationProperty