Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 37 additions & 13 deletions src/Accounts/Accounts/help/Enable-AzContextAutosave.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ schema: 2.0.0
# Enable-AzContextAutosave

## SYNOPSIS
Allow the azure credential, account and subscription information to be saved and automatically loaded when you open a PowerShell window.
Azure contexts are PowerShell objects representing your active subscription to run commands against,
and the authentication information needed to connect to an Azure cloud. With Azure contexts, Azure
PowerShell doesn't need to reauthenticate your account each time you switch subscriptions. For more
information, see [Azure PowerShell context objects](https://docs.microsoft.com/powershell/azure/context-persistence).

This cmdlet allows the Azure context information to be saved and automatically loaded when you start
a PowerShell process. For example, when opening a new window.

## SYNTAX

Expand All @@ -18,29 +24,37 @@ Enable-AzContextAutosave [-Scope <ContextModificationScope>] [-DefaultProfile <I
```

## DESCRIPTION
Allow the azure credential, account and subscription information to be saved and automatically loaded when you open a PowerShell window.

Allows the Azure context information to be saved and automatically loaded when a PowerShell process
starts. The context is saved at the end of the execution of any cmdlet that affects the context. For
example, any profile cmdlet. If you're using user authentication, then tokens can be updated during
the course of running any cmdlet.

## EXAMPLES

### Example 1: Enable autosaving credentials for the current user

Turn on credential autosave for the current user. Whenever a PowerShell window is opened, your
current context is remembered without logging in.

```powershell
PS C:\> Enable-AzContextAutosave
Enable-AzContextAutosave
```

Turn on credential autosave for the current user. Whenever a powershell window is opened, your current context will be remembered without logging in.

### Example 2

Allow the azure credential, account and subscription information to be saved and automatically loaded when you open a PowerShell window in this powershell session. (autogenerated)
Allow the Azure credential, account, and subscription information, to be saved and automatically
loaded when you open a PowerShell window in this PowerShell session. (autogenerated)

```powershell <!-- Aladdin Generated Example -->
```powershell <!-- Aladdin Generated Example -->
Enable-AzContextAutosave -Scope Process
```

## PARAMETERS

### -DefaultProfile
The credentials, tenant and subscription used for communication with azure

The credentials, tenant, and subscription used for communication with Azure

```yaml
Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
Expand All @@ -55,7 +69,11 @@ Accept wildcard characters: 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

Determines the scope of context changes. For example, whether changes apply only to the current
process, or to all sessions started by this user. Changes made with the scope `CurrentUser` will
affect all PowerShell sessions started by the user. If a particular session needs to have different
settings, use the scope `Process`.

```yaml
Type: Microsoft.Azure.Commands.Profile.Common.ContextModificationScope
Expand All @@ -65,12 +83,13 @@ Accepted values: Process, CurrentUser

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

### -Confirm

Prompts you for confirmation before running the cmdlet.

```yaml
Expand All @@ -86,8 +105,9 @@ Accept wildcard characters: False
```

### -WhatIf

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

```yaml
Type: System.Management.Automation.SwitchParameter
Expand All @@ -101,8 +121,12 @@ 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 (http://go.microsoft.com/fwlink/?LinkID=113216).
### Common Parameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

Expand Down