In this PowerShell azure tutorial, we will discuss how to fix the error, The term ‘Get-AzureAccount’ is not recognized as the name of a cmdlet and The specified module ‘Azure’ was not loaded because no valid module file was found. Both the error I got while running the PowerShell command to get the Subscription details.
The term ‘Get-AzureAccount’ is not recognized
Recently, while trying to get my Azure Subscription details using the below cmdlet, I got the error The term ‘Get-AzureAccount’ is not recognized as the name of a cmdlet, function, script file, or operable program.
I was executing the below PowerShell cmdlet
PS C:\WINDOWS\system32> Get-AzureAccount
The exact error message was
Get-AzureAccount: The term ‘Get-AzureAccount’ 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:2 char:1
- Get-AzureAccount
~~~~- CategoryInfo : ObjectNotFound: (Get-AzureAccount:String) [], CommandNotFoundExce
ption - FullyQualifiedErrorId : CommandNotFoundException
- CategoryInfo : ObjectNotFound: (Get-AzureAccount:String) [], CommandNotFoundExce
Now to fix the above error, Open the PowerShell ISE as run as administrator mode

i tried importing the Azure module using the below cmdlet
PS C:\WINDOWS\system32> Import-Module AzureBut after executing the above script, I got the below error again
Import-Module: The specified module ‘Azure’ was not loaded because no valid module file was found in any module directory.

The complete error message was as below
Import-Module: The specified module ‘Azure’ was not loaded because no valid module file was
found in any module directory.
At line:1 char:1
- Import-Module Azure
~~~~~~~- CategoryInfo : ResourceUnavailable: (Azure:String) [Import-Module], FileNotFound
Exception - FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModule
Command
- CategoryInfo : ResourceUnavailable: (Azure:String) [Import-Module], FileNotFound
The term ‘Get-AzureAccount’ is not recognized [Solved]
Now to fix both the above issues, you need to install the Azure module using the below cmdlet
PS C:\WINDOWS\system32> Install-Module Azure
Now once you will click on the Yes button on the Untrusted repository pop up, you can see below it started installing the required Azure module
