< Back
Select-AzureRmContext
Post
NAME Select-AzureRmContext
SYNOPSIS
Select a subscription and account to target in Azure PowerShell cmdlets
SYNTAX
Select-AzureRmContext [-DefaultProfile <IAzureContextContainer>] -InputObject <PSAzureContext> [-Scope {Process | CurrentUser}] [-Confirm]
[-WhatIf] [<CommonParameters>]
Select-AzureRmContext [-Name] <String> [-DefaultProfile <IAzureContextContainer>] [-Scope {Process | CurrentUser}] [-Confirm] [-WhatIf]
[<CommonParameters>]
DESCRIPTION
Select a subscription to target (or account or tenant) in Azure PowerShell cmdlets. After this cmdlet, future cmdlets will target the selected
context.
PARAMETERS
-DefaultProfile <IAzureContextContainer>
The credentials, tenant and subscription used for communication with azure
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-InputObject <PSAzureContext>
A context object, normally passed through the pipeline.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByValue)
Accept wildcard characters? false
-Name <String>
The name of the context
Required? true
Position? 0
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Scope <ContextModificationScope>
Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this
user
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
Default value False
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 (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
OUTPUTS
Microsoft.Azure.Commands.Profile.Models.PSAzureContext
NOTES
Example 1 : Target a named context
PS C:\\> Select-AzureRmContext "Work"
Target future Azure PowerShell cmdlets at the account, tenant, and subscription in the 'Work' context.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... ermcontext
SYNOPSIS
Select a subscription and account to target in Azure PowerShell cmdlets
SYNTAX
Select-AzureRmContext [-DefaultProfile <IAzureContextContainer>] -InputObject <PSAzureContext> [-Scope {Process | CurrentUser}] [-Confirm]
[-WhatIf] [<CommonParameters>]
Select-AzureRmContext [-Name] <String> [-DefaultProfile <IAzureContextContainer>] [-Scope {Process | CurrentUser}] [-Confirm] [-WhatIf]
[<CommonParameters>]
DESCRIPTION
Select a subscription to target (or account or tenant) in Azure PowerShell cmdlets. After this cmdlet, future cmdlets will target the selected
context.
PARAMETERS
-DefaultProfile <IAzureContextContainer>
The credentials, tenant and subscription used for communication with azure
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-InputObject <PSAzureContext>
A context object, normally passed through the pipeline.
Required? true
Position? named
Default value None
Accept pipeline input? True (ByValue)
Accept wildcard characters? false
-Name <String>
The name of the context
Required? true
Position? 0
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Scope <ContextModificationScope>
Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this
user
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
Default value False
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 (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
OUTPUTS
Microsoft.Azure.Commands.Profile.Models.PSAzureContext
NOTES
Example 1 : Target a named context
PS C:\\> Select-AzureRmContext "Work"
Target future Azure PowerShell cmdlets at the account, tenant, and subscription in the 'Work' context.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... ermcontext