Share via


Set-IISConfigAttributeValue

Letzte Aktualisierung: August 2015

Set-IISConfigAttributeValue

Sets a configuration attribute value for an IIS configuration section or configuration element attribute.

Syntax

Parameter Set: Default
Set-IISConfigAttributeValue [-ConfigElement] <ConfigurationElement> [-AttributeName] <String> [-AttributeValue] <Object> [-InformationAction <ActionPreference> {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend} ] [-InformationVariable <String> ] [ <CommonParameters>]

Detaillierte Beschreibung

The Set-IISConfigAttributeValue cmdlet sets a configuration attribute value from an Internet Information Services (IIS) configuration section attribute or a configuration element attribute. The value set is for the given ConfigurationElement and not necessarily the effective value for a given site / virtual directory / folder etc. To set the effective attribute values, always retrieve the configuration element by specifying the commit path as the deepest level possible.

Parameter

-AttributeName<String>

Specifies the name of the attribute for which the value will be set.

Aliase

none

Erforderlich?

true

Position?

2

Standardwert

none

Pipelineeingaben akzeptieren?

true(ByPropertyName)

Platzhalterzeichen akzeptieren?

false

-AttributeValue<Object>

Specifies the new value of the attribute.

Aliase

none

Erforderlich?

true

Position?

3

Standardwert

none

Pipelineeingaben akzeptieren?

true(ByPropertyName)

Platzhalterzeichen akzeptieren?

false

-ConfigElement<ConfigurationElement>

Specifies the IIS ConfigurationSection or ConfigurationElement for which the attribute value will be looked up.

Aliase

none

Erforderlich?

true

Position?

1

Standardwert

none

Pipelineeingaben akzeptieren?

true(ByValue,ByPropertyName)

Platzhalterzeichen akzeptieren?

false

-InformationAction<ActionPreference>

Specifies how this cmdlet responds to an information event. The acceptable values for this parameter are:

-- SilentlyContinue
-- Stop
-- Continue
-- Inquire
-- Ignore
-- Suspend

Aliase

infa

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-InformationVariable<String>

Specifies a variable in which to store an information event message.

Aliase

iv

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

<CommonParameters>

Dieses Cmdlet unterstützt die allgemeinen Parameter: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer und -OutVariable. Weitere Informationen finden Sie unter about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Eingaben

Der Eingabetyp ist der Typ der Objekte, die Sie per Piping an das Cmdlet übergeben können.

  • Microsoft.Web.Administration.ConfigurationElement, System.String, System.Object

Ausgaben

Der Ausgabetyp ist der Typ der Objekte, die vom Cmdlet ausgegeben werden.

Beispiele

Example 1: Set the value of a configuration attribute

This command sets the value of the configuration attribute MaxUrlSegments for the IIS website named Default Web Site to 16.

PS C:\> $ConfigSection = Get-IISConfigSection -SectionPath "system.applicationHost/sites"
PS C:\> $SitesCollection = Get-IISConfigCollection -ConfigElement $ConfigSection
PS C:\> $Site = Get-IISConfigCollectionElement -ConfigCollection $SitesCollection -ConfigAttribute @{Name = "Default Web Site"}
PS C:\> $Elem = Get-IISConfigElement -ConfigElement $Site -ChildElementName "limits"
PS C:\> Set-IISConfigAttributeValue -ConfigElement $Elem -AttributeName "MaxUrlSegments" -AttributeValue 16

Verwandte Themen

Get-IISConfigAttributeValue

IIS Administration Cmdlets