In this Azure PowerShell article, we will discuss the syntax and usage of the Select-AzureSubscription PowerShell command with examples of how to use this command.
Table of Contents
Select-AzureSubscription
This command can help you to set and clears your current and the default Azure subscriptions.
Syntax
Below is the syntax of the Select-AzureSubscription PowerShell command.
Select-AzureSubscription
-SubscriptionName <String>
Select-AzureSubscription
-SubscriptionId <String>
Let’s discuss a few examples of how to use the Select-AzureSubscription PowerShell command.
Example-1:
You can execute the below PowerShell command to set the specified subscription name as the current subscription.
Select-AzureSubscription -Current -SubscriptionName "Visual Studio Enterprise"
After executing the above command, I got the below-expected output. The specified subscription name has been set as the current subscription.

Example-2:
You can run the below Azure PowerShell command to set the specified subscription as the default subscription.
Select-AzureSubscription -Default -SubscriptionName "Visual Studio Enterprise"
After executing the above PowerShell command, I got the expected output as below.

You can also check out a video tutorial on the Select-AzureSubscription PowerShell Command.
Final Thoughts
In this Azure PowerShell article, we discussed the syntax and usage of the Select-AzureSubscription PowerShell command with examples of how to use this command.