< Back

Set-CDotNetAppSetting

Sun Jan 12, 2020 11:07 pm

NAME Set-CDotNetAppSetting



SYNOPSIS

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





SYNTAX

Set-CDotNetAppSetting [-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:



* .NET 2.0 32-bit (switches -Clr2 -Framework)

* .NET 2.0 64-bit (switches -Clr2 -Framework64)

* .NET 4.0 32-bit (switches -Clr4 -Framework)

* .NET 4.0 64-bit (switches -Clr4 -Framework64)



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





PARAMETERS

-Name <String>

The name of the app setting to be set



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Value <String>

The valie of the app setting to be set.



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Framework [<SwitchParameter>]

Set the app setting in the 32-bit machine.config.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Framework64 [<SwitchParameter>]

Set the app setting in the 64-bit machine.config. Ignored if running on a 32-bit operating system.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Clr2 [<SwitchParameter>]

Set the app setting in the .NET 2.0 machine.config.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Clr4 [<SwitchParameter>]

Set the app setting in the .NET 4.0 machine.config.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



>Set-CDotNetAppSetting -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`









-------------------------- EXAMPLE 2 --------------------------



>Set-CDotNetAppSetting -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`











RELATED LINKS

Remove-CDotNetAppSetting

Set-CDotNetConnectionString