powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Set-WebConfigurationProperty



NAME
Set-WebConfigurationProperty

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

SYNTAX
Set-WebConfigurationProperty -Name -Value [-AtElement ] [-AtIndex ] [-AtName
] [-Force] [-Location ] [-Filter] [[-PSPath] ] [-WarningAction ence>] [-WarningVariable ] [-WhatIf] [-Confirm] []

Set-WebConfigurationProperty -Name -InputObject [-AtElement ] [-AtIndex ] [-AtN
ame ] [-Force] [-Location ] [-Filter] [[-PSPath] ] [-WarningAction eference>] [-WarningVariable ] [-WhatIf] [-Confirm] []


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


PARAMETERS
-Name
The name of the configuration property to be changed.

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

-Value
The value of the configuration setting to be changed.

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

-AtElement
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
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
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
The Force parameter is used cause the configuration property setting to be set at a level above a lock in the c
onfiguration.

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. 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
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

-WhatIf
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
Prompts you for confirmation before executing the command.

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

-InputObject


Required? true
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
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: Change the extension of all handlers mapped to .aspx --------------

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


The command will change all handler paths mapped to *.aspx to *.mspx.





-------------- EXAMPLE 2: Setting new Bindings on an existing WebSite --------------

C:\PS>set-webconfigurationproperty '/system.applicationHost/sites/site[@name="DemoSite"]' -PSPath IIS:\ -Name Bindi
ngs -Value (@{protocol="http";bindingInformation="*:80:DemoSite1"},@{protocol="http";bindingInformation="*:80:DemoS
ite2"})


This command sets new bindings on an existing Web-Site. The original bindings will be replaced.






RELATED LINKS