Come and Check our BETA Alpha version of Powershellcenter.net
Send me your comment to Powershell@powershellcenter.com

Synopsis

Sets the value of an IIS configuration setting to the value specified in the command.

Syntax

Set-WebConfigurationProperty -Name <String> -Value <PSObject> [-AtElement <Hashtable>] [-AtIndex <Int32>] [-AtName <String>] [-Force] [-Location <String[]>] [-Filter] <String[]> [[-PSPath] <String[]>] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [-WhatIf] [-Confirm] [<CommonParameters>]

Set-WebConfigurationProperty -Name <String> -InputObject <Object> [-AtElement <Hashtable>] [-AtIndex <Int32>] [-AtName <String>] [-Force] [-Location <String[]>] [-Filter] <String[]> [[-PSPath] <String[]>] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [-WhatIf] [-Confirm] [<CommonParameters>]

Detailed Description

The Set-WebConfigurationProperty cmdlet changes the value of an IIS configuration element. The element can be specified as a configuration section or a XPath query. Set-WebConfigurationProperty supports globbing.

Parameters

-Name [<String>]

The name of the configuration property to be changed.

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

-Value [<PSObject>]

The value of the configuration setting to be changed.

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

-AtElement [<Hashtable>]

The element at which the configuration property is set.

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

-AtIndex [<Int32>]

The index at which the configuration property is set.

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

-AtName [<String>]

The name of the collection property for which the value is set.

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

-Force [<SwitchParameter>]

The Force parameter is used cause the configuration property setting to be set at a level above a lock in the configuration.

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

-Location [<String[]>]

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 are an example. Location tags are also used is if a particular section is locked. If so the configuration system has to use location tags in one of the parent configuration files.

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

-Filter [<String[]>]

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 [<String[]>]

Specifies the configuration path. This can be either an IIS configuration path (e.g. machine/webroot/apphost) or 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 [<ActionPreference>]

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

-WarningVariable [<String>]

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

-WhatIf [<SwitchParameter>]

Describes what would happen if you executed the command without actually executing the command.

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

-Confirm [<SwitchParameter>]

Prompts you for confirmation before executing the command.

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

-InputObject [<Object>]

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

Input Type

PSObject

Return Type

PSObject

Notes

Examples

EXAMPLE 1: Change the extension of all handlers mapped to .aspx

PS> Set-WebConfigurationProperty "//handlers/add[@path='*.aspx']" -PSPath IIS:\ -Name path