Posh-git: How to uninstall posh-git from powershell?

Created on 19 Mar 2018  ·  2Comments  ·  Source: dahlbyk/posh-git

I had installed it.But i found i don't like it.
So ,i try to uninstall it ,but i don't know how .
I delete the posh-git floder directly.

However, everytime I open powershell,it warns like this:

Import-Module : 未能加载指定的模块“C:\Windows\System32\WindowsPowerShell\v1.0\posh-git\src\posh-git.psd1”,因为在任何
模块目录中都没有找到有效模块文件。
所在位置 C:\Users\Andy\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:2 字符: 1
+ Import-Module 'C:\Windows\System32\WindowsPowerShell\v1.0\posh-git\sr ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (C:\Windows\Syst...c\posh-git.psd1:String) [Import-Module], FileNot
   FoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

Import-Module : 未能加载指定的模块“C:\Windows\System32\WindowsPowerShell\v1.0\posh-git\src\posh-git.psd1”,因为在任何
模块目录中都没有找到有效模块文件。
所在位置 C:\Users\Andy\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:4 字符: 1
+ Import-Module 'C:\Windows\System32\WindowsPowerShell\v1.0\posh-git\sr ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (C:\Windows\Syst...c\posh-git.psd1:String) [Import-Module], FileNot
   FoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

So,who can teach me how to uninstall it from powershell?

Most helpful comment

Open $PROFILE in your favorite editor (e.g. notepad $PROFILE) and delete the line(s) with:

Import-Module 'C:\Windows\System32\WindowsPowerShell\v1.0\posh-git\src\posh-git.psd1

All 2 comments

Open $PROFILE in your favorite editor (e.g. notepad $PROFILE) and delete the line(s) with:

Import-Module 'C:\Windows\System32\WindowsPowerShell\v1.0\posh-git\src\posh-git.psd1

Thanks ~~!! It works!

Was this page helpful?
0 / 5 - 0 ratings