powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Set-WebConfiguration



NAME
Set-WebConfiguration

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

SYNTAX
Set-WebConfiguration -Value [-Metadata ] [-Force] [-Location ] [-Filter] [[
-PSPath] ] [-WarningAction ] [-WarningVariable ] [-WhatIf] [-Confirm] [ arameters>]

Set-WebConfiguration -InputObject [-Metadata ] [-Force] [-Location ] [-Filter] > [[-PSPath] ] [-WarningAction ] [-WarningVariable ] [-WhatIf] [-Confirm] [ monParameters>]


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


PARAMETERS
-Value
The value of the configuration setting to change.

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

-Metadata
If this parameter is specified, configuration metadata like encryption or locking settings can be changed.

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

-Force
When the Force parameter is used, it causes the configuration 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
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: Setting new Bindings on an existing Web site --------------

C:\PS>Set-WebConfiguration -filter '/system.applicationHost/sites/site[@name=" DemoSite"]/bindings' -PSPath IIS:\ -
value (@{protocol="http";bindingInformation="*:80:DemoSite1"},@{protocol="http";bindingInformation="*:80:DemoSite2"
})


The Set-WebConfiguration cmdlet is used to replace the existing bindings of the Web site named "DemoSite" with new
bindings. The existing bindings are replaced.






RELATED LINKS