Install-Module : The term 'Install-Module' is not recognized as the name of a cmdlet

245,136

Solution 1

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

import-Module "Path of the file.psm1"

Here is the link to download the Azure Module: Azure Powershell

This will do your work.

Solution 2

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.

Solution 3

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-Module

PS > $psversiontable
Name                           Value
----                           -----
PSVersion                      5.1.14393.576
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.576
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

More information about install Azure PowerShell, refer to the link.

Solution 4

I have Windows 10 and PowerShell 5.1 was already installed. For whatever reason the x86 version works and can find "Install-Module", but the other version cannot.

Search your Start Menu for "powershell", and find the entry that ends in "(x86)":

Windows 10 Start Menu searching for PowerShell

Here is what I experience between the two different versions:

PowerShell x86 vs x64 running Install-Module cmdlet comparison

Solution 5

I lost couple of days trying to resolve this until I got a simple solution. I just copy from another Win10 machine with a working Powershell 5.1 installation the following directories:

  • C:\Program Files\WindowsPowerShell\Modules\PackageManagement
  • C:\Program Files\WindowsPowerShell\Modules\PowerShellGet

To the same directories in the problem machine and don't change permissiones or anything and just run the command Install-Module and the problem was solved. I hope this can help some tormented soul.

Share:
245,136
Martin Erlic
Author by

Martin Erlic

Personal Portfolio: http://www.martinerlic.com/ GitHub: https://github.com/seloslav LinkedIn: https://www.linkedin.com/in/martin-erlic/ Hey! My name is Martin. I am an experienced Software Engineer and Product Developer with a demonstrated history of working in the computer software industry. I am currently located in Victoria, BC. I love bringing products to life, from napkin sketch to working prototype and beyond. While I enjoy working in a collaborative team environment, I have extensive experience building and shipping my own products to the Google PlayStore and Apple App Store from the ground up. Want to build something great? Feel free to get in touch. I am interested in partnering with startups and small businesses to help them create lightning fast, strategic web and app solutions to help them grow. Skilled in Cloud Software, Databases, API Integrations, Web & Mobile Applications and UI Design. Web, Android and iOS applications HTML, CSS, JavaScript, Java, .NET, Kotlin, Swift ReactJS, React-Native, Blazor, MongoDB, CosmosDB, Entity Framework, Realm, Parse-Server Strong engineering and business development professional with a Bachelor of Arts - BA focused in Economics from University of Victoria.

Updated on July 09, 2022

Comments

  • Martin Erlic
    Martin Erlic almost 2 years

    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?

  • Martin Erlic
    Martin Erlic over 7 years
    What do you mean by "download the module in your local folder"? Can I download it from the internet?
  • Ranadip Dutta
    Ranadip Dutta over 7 years
    @santafebound: Yes of course you can download the module from Internet. I think it is already there in Github..
  • Ranadip Dutta
    Ranadip Dutta over 7 years
    @santafebound : I have modified the answer and given you the Github link to download the module .. :)
  • Martin Erlic
    Martin Erlic over 7 years
    Thanks. I'll take a look now!
  • Ranadip Dutta
    Ranadip Dutta over 7 years
    @santafebound: Accept the answer it it helps you.
  • andrew pate
    andrew pate over 7 years
    Here is a link for powershell 5.0 microsoft.com/en-us/download/…
  • gs_za
    gs_za over 6 years
    A permanent solution is as provided by @venkatesh-muniyandi below
  • Hicsy
    Hicsy almost 6 years
    This seemed like it would be a cool work-around, Unfortunately this has the same issue - you need powershell 3+ and dotnet 4.5 installed first... which would then give you the command "install-module" anyway.
  • flowerpowerdad
    flowerpowerdad almost 6 years
    Same thing just happened to me - typing manually instead of copy&paste saved the day after 10 minutes of teeth grinding. Thanks for heads up
  • Karthick Ganesan
    Karthick Ganesan about 5 years
    @RanadipDutta You saved my day. Thanks a million :)
  • Ranadip Dutta
    Ranadip Dutta about 5 years
    @KarthickGanesan: Glad I could help. :)
  • velkoon
    velkoon almost 5 years
    Instead of saying "Path of the file.psm1" can you please download the Github repository for me and find the exact module I need to import? I cannot find anything in the .zip from Github that's called AzureAd.psm1 or anything named AzureAd-anything.
  • Jason
    Jason over 4 years
    This might not be the issue in all cases. I have PSVersion 5.1.18362.145 and Install-Module is [still] not recognized as the name of a cmdlet, function, script file, or operable program.
  • cdonner
    cdonner about 4 years
    The link is broken.
  • Venkatesh Muniyandi
    Venkatesh Muniyandi over 3 years
    Fixed the broken link