2015-04-02 101 views
0

安装豪华-git的 - 在这里看到https://github.com/dahlbyk/posh-git术语“安装,模块未被识别为cmdlet,函数的名称,脚本文件或可操作的程序

如果我刚刚安装PsGet装然后运行:

Install-Module posh-git 

工作正常。

但是,如果我关闭并重新启动PowerShell的话,我得到:

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

当我尝试和运行它。

任何想法为什么?

+0

它只为它似乎安装。也许您只需将该代码添加到您的[PowerShell配置文件](http://blogs.technet.com/b/heyscriptingguy/archive/2012/05/21/understanding-the-six-powershell-profiles.aspx)。 – Matt 2015-04-02 20:54:34

+1

['Install-Module'一词不能被识别为cmdlet的名称]的可能重复(http://stackoverflow.com/questions/29828756/the-term-install-module-is-not-recognized-as -the-名称对的一小命令) – 2017-01-11 02:04:36

回答

0

一旦模块已经安装,您通常使用导入模块重新加载它例如:

Import-Module posh-git 

这就是说,更高版本的PowerShell(V3及以上)会自动加载的模块,如果你试图执行来自该模块的命令。这确实假设PowerShell可以发现posh-git模块中的命令。

相关问题