SOLVED

The posh-git.psd1 file not loaded error

Iron Contributor

Over the weekend I replaced a failing HD with an SSD. Reinstalled Windows 10. Then I tried to install posh-git for PowerShell, but I must have done something wrong. Every time I get into PowerShell now, I get this error message:

 

Import-Module : The specified module 'C:\tools\poshgit\dahlbyk-posh-git-9bda399\src\posh-git.psd1' was not loaded
because no valid module file was found in any module directory.
At C:\Users\rodf\OneDrive\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:2 char:1
+ Import-Module 'C:\tools\poshgit\dahlbyk-posh-git-9bda399\src\posh-git ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (C:\tools\poshgi...c\posh-git.psd1:String) [Import-Module], FileNot
FoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

 

I've tried uninstalling posh-git, but don't know how to do that. In fact, I'm not even sure it's installed. How do I fix this problem and get posh-git working properly, please?

2 Replies
best response confirmed by Rod Falanga (Iron Contributor)
Solution

@Rod Falanga 

Looks like you have an entry in one of your Powershell profile files. Check out $Profile variable in Powershell to get your profile file location. Open that file and remove the posh-git entry.

 

Hope it helps!

Grtz, Manfred de Laat

It worked for me. Thank you, @Manfred101
1 best response

Accepted Solutions
best response confirmed by Rod Falanga (Iron Contributor)
Solution

@Rod Falanga 

Looks like you have an entry in one of your Powershell profile files. Check out $Profile variable in Powershell to get your profile file location. Open that file and remove the posh-git entry.

 

Hope it helps!

Grtz, Manfred de Laat

View solution in original post