powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Clear-WebConfiguration



NAME
Clear-WebConfiguration

SYNOPSIS
Removes configuration settings from the configuration location specified.

SYNTAX
Clear-WebConfiguration [-Force] [-Location ] [-Filter] [[-PSPath] ] [-WarningAction
] [-WarningVariable ] [-WhatIf] [-Confirm] []


DESCRIPTION
Removes configuration settings from the configuration location specified.


PARAMETERS
-Force
Forces the specified configuration to be cleared.

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

-Location
The location of the configuration setting to clear. Location tags are usually used for configuration settings t
hat need to be more granular than per application or per virtual directory. Settings for particular files or a
specific directory are an example. Location tags are also used if a particular section is locked. If this case,
the configuration system has to use location tags in a parent configuration file.

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


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

INPUTS



OUTPUTS



NOTES




-------------- EXAMPLE 1: Removing ASP configuration on the root node --------------

C:\PS>Clear-WebConfiguration -Filter /system.webServer/asp -PSPath 'IIS:\'


This command removes the section from the root node.





-------------- EXAMPLE 2: Remove a configuration property from the root node --------------

C:\PS>Clear-WebConfiguration -Filter /system.webServer/asp/@lcid -PSPath 'IIS:\'


This example removes the lcid property from the IIS configuration root node.





-------------- EXAMPLE 3: Removing configuration from the site node --------------

C:\PS>Clear-WebConfiguration -Filter /system.webServer/asp -PSPath 'IIS:\sites\Default Web Site'


Remove the section from the IIS configuration node for the Default Web Site.






RELATED LINKS
Get-WebConfiguration
Set-WebConfiguration