Install-Module : The term ‘Install-Module’ is not recognized as the name of a cmdlet, function, script file, or operable program

In this SharePoint PowerShell tutorial we will discuss how to solve Install-Module : The term ‘Install-Module’ is not recognized as the name of a cmdlet, function, script file, or operable program error which comes while running Install-Module SharePointPnPPowerShellOnline command to install PnP SharePoint Online.

Install-Module : The term ‘Install-Module’ is not recognized as the name of a cmdlet, function, script file, or operable program

Recently, I was trying to use PnP PowerShell to connect to SharePoint Online sites.

To install PnP PowerShell cmdlets, I was trying to install Install-Module SharePointPnPPowerShellOnline. But it gave me error as:

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 SharePointPnPPowerShellOnline. 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
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 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.

$PSVersionTable.PSVersion

My PowerShell major version was 4.

To solve the error follow below steps.

Download Windows Management Framework 5.1

Here make sure to choose Win8.1AndW2K12R2-KB3191564-x64.msu if you have Windows server 2012 or 2012 R2 machine.

Install-Module : The term 'Install-Module' is not recognized as the name of a cmdlet, function, script file, or operable program
Install-Module : The term ‘Install-Module’ is not recognized as the name of a cmdlet, function, script file, or operable program

Download and install Download Windows Management Framework 5.1, then it will ask to restart the machine like below:

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

You may like following SharePoint PowerShell tutorials:

Once you restart the machine and try running Install-Module SharePointPnPPowerShellOnline command, the error will not come.

>