In this PowerShell Azure tutorial, we will discuss how to fix the error. The term ‘get-azuresubscription’ is not recognized when retrieving the Azure Subscription details using the Azure PowerShell cmdlet.
Recently, While working with Azure PowerShell. I was trying to retrieve the Azure Subscription details using the Azure PowerShell cmdlet, and I got this error. I was using the below PowerShell cmdlet
PS C:\WINDOWS\system32> get-azuresubscriptionAfter executing the above PowerShell cmdlet, I got this error. You can see it below

The exact error message was below
get-azuresubscription : The term ‘get-azuresubscription’ is not recognized as the
name of a cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
- get-azuresubscription
~~~~~- CategoryInfo : ObjectNotFound: (get-azuresubscription:String) [], Comm
andNotFoundException - FullyQualifiedErrorId : CommandNotFoundException
- CategoryInfo : ObjectNotFound: (get-azuresubscription:String) [], Comm
Solution
To fix this error, I followed the below steps.
- Open the PowerShell ISE as Run as Administrator mode

2. Install the PowerShell module Azure using the below PowerShell cmdlet. Then click on the Yes to All button to confirm the installation of the Azure Module.
PS C:\WINDOWS\system32> Install-Module -Name Azure -AllowClobber -Scope CurrentUser
3. Now, you can see below that the installation has been started.

4. Once the Azure module is installed successfully, You can run the below PowerShell cmdlet. First, it will ask you to log in with your Azure Credentials, and then it will provide you with your Azure Subscription details.
Add-AzureAccount
get-azuresubscription
However, the old Azure Service Management (ASM) model, the get-azuresubscription, is used to retrieve the subscription details. The new model is the Azure Resource Manager (ARM), and you can use the PowerShell cmdlet Get-AzureRmSubscription to retrieve your Azure Subscription details.
PS C:\WINDOWS\system32> Get-AzureRmSubscription
You may also like following the below Articles

I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.
