Edit

Share via


Get-AzContextAutosaveSetting

Display metadata about the context autosave feature, including whether the context is automatically saved, and where saved context and credential information can be found.

Syntax

Default (Default)

Get-AzContextAutosaveSetting
    [-Scope <ContextModificationScope>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

Display metadata about the context autosave feature, including whether the context is automatically saved, and where saved context and credential information can be found.

Examples

Example 1: Get context save metadata for the current session

Get-AzContextAutosaveSetting
Mode             : Process
ContextDirectory : None
ContextFile      : None
CacheDirectory   : None
CacheFile        : None
Settings         : {}

Get details about whether and where the context is saved. In the above example, the autosave feature has been disabled.

Example 2: Get context save metadata for the current user

Get-AzContextAutosaveSetting -Scope CurrentUser
Mode             : CurrentUser
ContextDirectory : C:\Users\contoso\AppData\Roaming\Windows Azure Powershell
ContextFile      : AzureRmContext.json
CacheDirectory   : C:\Users\contoso\AppData\Roaming\Windows Azure Powershell
CacheFile        : TokenCache.dat
Settings         : {}

Get details about whether and where the context is saved by default for the current user. Note that this may be different than the settings that are active in the current session. In the above example, the autosave feature has been enabled, and data is saved to the default ___location.

Parameters

-DefaultProfile

The credentials, account, tenant and subscription used for communication with azure

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Scope

Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user.

Parameter properties

Type:ContextModificationScope
Default value:None
Accepted values:Process, CurrentUser
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

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

Inputs

None

Outputs

ContextAutosaveSettings