Sets an app setting in the .NET machine.config file.
Set-DotNetAppSetting [-Name] <String> [-Value] <String> [-Framework] [-Framework64] [-Clr2] [-Clr4] [-WhatIf] [-Confirm] [<CommonParameters>]
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.
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 | False |
Framework64 | SwitchParameter | Set the app setting in the 64-bit machine.config. Ignored if running on a 32-bit operating system. |
false | false | False |
Clr2 | SwitchParameter | Set the app setting in the .NET 2.0 machine.config. |
false | false | False |
Clr4 | SwitchParameter | Set the app setting in the .NET 4.0 machine.config. |
false | false | False |
WhatIf | SwitchParameter | false | false | ||
Confirm | SwitchParameter | false | false | ||
CommonParameters | This cmdlet supports common parameters. For more information type Get-Help about_CommonParameters . |
Set-DotNetAppSetting -Name ExampleUrl -Value example.com -Framework -Framework64 -Clr2 -Clr4
Sets the ExampleUrl app setting in the following machine.config files:
%SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config
%SYSTEMROOT%\Microsoft.NET\Framework64\v2.0.50727\CONFIG\machine.config
%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319\CONFIG\machine.config
%SYSTEMROOT%\Microsoft.NET\Framework64\v4.0.30319\CONFIG\machine.config
Set-DotNetAppSetting -Name ExampleUrl -Value example.com -Framework64 -Clr4
Sets the ExampleUrl app setting in the following machine.config file:
%SYSTEMROOT%\Microsoft.NET\Framework64\v4.0.30319\CONFIG\machine.config