Recently, I was trying to use Install-Module cmdlet to install a required module for some testing on a client machine however I ran into the following error
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 correct and try again.
At line:1 char:1Install-Module MSOnline. CategoryInfo : ObjectNotFound: (Install-Module:String) [], CommandNotFoundException FullyQualifiedErrorId : CommandNotFoundException
The error looks like below:
Install-Module : The term ‘Install-Module’ is not recognized as the name of a cmdlet, function, script file, or operable program
The error usually comes, if your PowerShell is not upto date. The major version of PowerShell should be equal or greater than 5. You can run the below cmdlets to check the PowerShell version.
1
$PSVersionTable.PSVersion
My PowerShell major version was 4.
Solution:
Download and install
https://www.microsoft.com/en-us/download/details.aspx?id=54616