Snowcrash
Snowcrash

Reputation: 86337

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

Installing posh-git - see here https://github.com/dahlbyk/posh-git

If I've just installed PsGet installed then running:

Install-Module posh-git

works fine.

But if I close and re-launch Powershell then I get:

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

when I try and run it.

Any idea why?

Upvotes: 0

Views: 6799

Answers (1)

Keith Hill
Keith Hill

Reputation: 202042

Once the module has been installed, you typically use Import-Module to reload it e.g.:

Import-Module posh-git

That said, later versions of PowerShell (V3 and above) will autoload the module if you attempt to execute a command from that module. This does assume that PowerShell can discover the command in the posh-git module.

Upvotes: 1

Related Questions