Set-DotNetAppSetting

Sets an app setting in the .NET machine.config file.

Syntax

Set-DotNetAppSetting [-Name] <String> [-Value] <String> [-Framework] [-Framework64] [-Clr2] [-Clr4] [-WhatIf] [-Confirm] [<CommonParameters>]

Description

The app setting can be set in up to four different machine.config files:

Any combination of Framework and Clr switch can be used, but you MUST supply one of each.

Parameters

Name Type Description Required? Pipeline Input Default Value
Name String The name of the app setting to be set true false
Value String The valie of the app setting to be set. true false
Framework SwitchParameter Set the app setting in the 32-bit machine.config. false false
Framework64 SwitchParameter Set the app setting in the 64-bit machine.config. Ignored if running on a 32-bit operating system. false false
Clr2 SwitchParameter Set the app setting in the .NET 2.0 machine.config. false false
Clr4 SwitchParameter Set the app setting in the .NET 4.0 machine.config. false false
WhatIf SwitchParameter false false
Confirm SwitchParameter false false
CommonParameters This cmdlet supports common parameters. For more information type
Get-Help about_CommonParameters.

EXAMPLE 1

Set-DotNetAppSetting -Name ExampleUrl -Value example.com -Framework -Framework64 -Clr2 -Clr4

Sets the ExampleUrl app setting in the following machine.config files:

EXAMPLE 2

Set-DotNetAppSetting -Name ExampleUrl -Value example.com -Framework64 -Clr4

Sets the ExampleUrl app setting in the following machine.config file: