powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Add-WebConfiguration



NAME
Add-WebConfiguration

SYNOPSIS
Adds an collection element to an IIS configuration collection.

SYNTAX
Add-WebConfiguration [-Value ] [-AtElement ] [-AtIndex ] [-AtName ] [-Force] [-
Location ] [-Filter] [[-PSPath] ] [-WarningAction ] [-WarningVaria
ble ] [-WhatIf] [-Confirm] []


DESCRIPTION
The Add-WebConfiguration cmdlet adds a collection element to an existing IIS configuration collection.


PARAMETERS
-Value
The value to add to the configuration collection. This can be a single value or a value/key combination in a ha
sh table.

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

-AtElement
The element in the collection location at which the value is to be inserted.

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

-AtIndex
The index at which the value is to be inserted.

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

-AtName
The name at which the value is to be inserted.

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

-Force
Overrides existing element settings.

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

-Location
The location to which the configuration is written.

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

-Filter
A configuration section or an XPath query that returns a configuration section or a configuration element that
contains a collection.

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


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: Adding a new Default Document --------------

C:\PS>Add-WebConfiguration //defaultDocument/files "IIS:\sites\Default Web Site" -atIndex 0 -Value @{value="new-in
dex.html"}


This example adds a new Default Document to the Default Document collection of the Default Web Site. By using "-at
Index 0" the new Default Document is inserted at the top of the list.






RELATED LINKS
Add-WebConfigurationProperty
Remove-WebConfiguration
Set-WebConfiguration