0

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?

Snowcrash
  • 80,579
  • 89
  • 266
  • 376
  • It is installed for that session only it seems. Perhaps you just need to add that code into your [PowerShell profile](http://blogs.technet.com/b/heyscriptingguy/archive/2012/05/21/understanding-the-six-powershell-profiles.aspx). – Matt Apr 02 '15 at 20:54
  • 1
    Possible duplicate of [The term 'Install-Module' is not recognized as the name of a cmdlet](http://stackoverflow.com/questions/29828756/the-term-install-module-is-not-recognized-as-the-name-of-a-cmdlet) – Michael Freidgeim Jan 11 '17 at 02:04

1 Answers1

1

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.

Keith Hill
  • 194,368
  • 42
  • 353
  • 369