Skip to content

Set-ContextSetting

SYNOPSIS

Sets a setting in a context.

SYNTAX

Set-ContextSetting [-Name] <String> [-Value] <Object> [-Context] <String> [-ProgressAction <ActionPreference>]
 [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

Sets a setting in the specified context. To store a secret, use the name 'Secret'.

EXAMPLES

EXAMPLE 1

Set-ContextSetting -Name 'ApiBaseUri' -Value 'https://api.github.com' -Context 'GitHub'

Sets a setting called 'ApiBaseUri' in the context called 'GitHub'.

EXAMPLE 2

$secret = 'myAccessToken' | ConvertTo-SecureString -AsPlainText -Force
Set-ContextSetting -Name 'Secret' -Value $secret -Context 'GitHub'

Sets a secret in the configuration context called 'GitHub'.

PARAMETERS

-Name

The name of the setting to set.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Value

The value to set for the specified setting. This can be a plain text string or a secure string.

Type: Object
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Context

The name of the context where the setting will be set.

Type: String
Parameter Sets: (All)
Aliases: ContextName

Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

System.Void

NOTES