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

While working on Poweshell DSC, I ran into below 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.

After wasting hours troubleshooting this I realized that “PowerShellGet” was deleted somehow, and so it was not able to find relevant modules for downloading other modules.

C:\Program Files\WindowsPowerShell\Modules\PowerShellGet

You can copy this folder from any other VM and retry, in my case I copied from my Windows 10 vm and it started working fine.

Hope this will save your hours of troubleshooting.

Contact Me:- 

@MyYouTubeChannel, @Gmail@Facebook , @Twitter, @LinkedIn @MSDNTechnet, @My Personal Blog

Leave a comment