SOLVED

The posh-git.psd1 file not loaded error

%3CLINGO-SUB%20id%3D%22lingo-sub-1439089%22%20slang%3D%22en-US%22%3EThe%20posh-git.psd1%20file%20not%20loaded%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1439089%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EOver%20the%20weekend%20I%20replaced%20a%20failing%20HD%20with%20an%20SSD.%20Reinstalled%20Windows%2010.%20Then%20I%20tried%20to%20install%20posh-git%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Efor%20PowerShell%2C%20but%20I%20must%20have%20done%20something%20wrong.%20Every%20time%20I%20get%20into%20PowerShell%20now%2C%20I%20get%20this%20error%20message%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22lia-indent-padding-left-30px%22%3EImport-Module%20%3A%20The%20specified%20module%20'C%3A%5Ctools%5Cposhgit%5Cdahlbyk-posh-git-9bda399%5Csrc%5Cposh-git.psd1'%20was%20not%20loaded%3CBR%20%2F%3Ebecause%20no%20valid%20module%20file%20was%20found%20in%20any%20module%20directory.%3CBR%20%2F%3EAt%20C%3A%5CUsers%5Crodf%5COneDrive%5CDocuments%5CWindowsPowerShell%5CMicrosoft.PowerShell_profile.ps1%3A2%20char%3A1%3CBR%20%2F%3E%2B%20Import-Module%20'C%3A%5Ctools%5Cposhgit%5Cdahlbyk-posh-git-9bda399%5Csrc%5Cposh-git%20...%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20ResourceUnavailable%3A%20(C%3A%5Ctools%5Cposhgi...c%5Cposh-git.psd1%3AString)%20%5BImport-Module%5D%2C%20FileNot%3CBR%20%2F%3EFoundException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20Modules_ModuleNotFound%2CMicrosoft.PowerShell.Commands.ImportModuleCommand%3C%2FP%3E%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20tried%20uninstalling%20posh-git%2C%20but%20don't%20know%20how%20to%20do%20that.%20In%20fact%2C%20I'm%20not%20even%20sure%20it's%20installed.%20How%20do%20I%20fix%20this%20problem%20and%20get%20posh-git%20working%20properly%2C%20please%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1439089%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1440139%22%20slang%3D%22en-US%22%3ERe%3A%20The%20posh-git.psd1%20file%20not%20loaded%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1440139%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F97487%22%20target%3D%22_blank%22%3E%40Rod%20Falanga%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELooks%20like%20you%20have%20an%20entry%20in%20one%20of%20your%20Powershell%20profile%20files.%20Check%20out%20%24Profile%20variable%20in%20Powershell%20to%20get%20your%20profile%20file%20location.%20Open%20that%20file%20and%20remove%20the%20posh-git%20entry.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20it%20helps!%3C%2FP%3E%3CP%3EGrtz%2C%20Manfred%20de%20Laat%3C%2FP%3E%3C%2FLINGO-BODY%3E
Frequent 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?

1 Reply
best response confirmed by Rod Falanga (Frequent 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