I was trying to install Azure using Install-Module Azure
in PowerShell. I got the following error:
PS C:\Windows\system32> Install-Module Azure
Install-Module : The term 'Install-Module' 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 corre
ct and try again.
At line:1 char:1
+ Install-Module Azure
+ ~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Install-Module:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Why is PS not recognizing the basic Install module? Without this I can't even install Azure. What should I do?
You should install the latest version of PowerShell, then use this command
Install-Module Azure
to install azure module. Because from Powershell 5.0 onwards you , you will be able to use the cmdlet to Install-Module, Save-ModuleMore information about install Azure PowerShell, refer to the link.
Another GUI based option to fix this error is to download the PackageManagement PowerShell Modules (msi installer) from Microsoft website and install the modules.
Once this is installed you will not get "'Install-Module' is not recognized as the name of a cmdlet" error.
Actually my solution to this problem was much simpler, because I already had the latest version of PowerShell and is still didn't recognize
Install-Module
command. What fixed the "issue" for me was just typing the command manually, since originally I tried copying the snippet from a website and apparently there was some issue with the formatting when copy&pasting, so when I typed the command manually it installed the module without any problem.If you are trying to install a module that is listed on the central repository for PS content called PowerShell Gallery, you need to install PowerShellGet. Then the command will be available. I'm currently using PS 4.0. Installing PowerShellGet did the trick for me.
Source:
With the latest PowerShellGet module, you can:
Another great article to get started with PS Gallery.
Since you are using the lower version of PS:
What you can do in your case is you first download the module in your local folder.
Then, there will be a .psm1 file under that folder for this module.
You just
Here is the link to download the Azure Module: Azure Powershell
This will do your work.