-
-
Notifications
You must be signed in to change notification settings - Fork 802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to import posh-git #442
Comments
What output do you get when you run |
Posh-git is in a folder called c:\tools\poshgit\dahlbyk-posh-git-7d93c81. So is that my issue? I need to have that directory in the PSModulePath? |
There are several ways to solve this. You could add that path to your system's PSModulePath environment variable but that path will likely change when you update to a new version (new SHA1). Another option is to simply import the module by path. Remove all the stuff you added from profile.example.ps1 and add this to your profile: Import-Module C:\tools\poshgit\dahlbyk-posh-git-7d93c81\src\posh-git.psd1
Start-SshAgent -Quiet When you update to a newer version you will need to remember to update your profile to use the new path. But I think it is easier to edit a file than it is to edit an environment variable. |
Thanks. That explains it. |
☝️ is what I was going to say, and then I checked the code and noticed that it is set up to continue using |
Yes, I did install via chocolatey. Originally (a few years ago), I followed the instructions at https://mva.microsoft.com/en-us/training-courses/using-git-with-visual-studio-2013-jump-start-8306?l=WGG4QtYy_8604984382 Just to further fill in how I got here: What started the notion to upgrade posh-git is that I found that git and posh-git were not working, having not used them in several months. So I went to posh-git and saw the chocolately instructions, and remembered that's how I originally installed. I had to reinstall chocolatey because it wasn't working correctly. After I got chocolatey back working, I then installed using |
Thanks for the detail. There's a good chance you still had the old |
Started working on improving this experience: #444 |
System Details
Issue Description
Amateur here who uses posh-git for hobby projects. posh-git's been working fine. On a whim, I updated the other day, now when I start my powershell I get a yellow warning saying I should copy the contents of the profile.example.ps1 to the $PROFILE. When I copy the contents of the profile.example.ps1 into my Microsoft.PowerShell_profile.ps1 file, I get the error message "Failed to import posh-git" and posh-git will not work.
I thought I might type in the commandlet to see what I get:
get-module posh-git -ListAvailable
But I get nothing. If I restore my Powershell profile back so it points to the original profile.example.ps1, it again works fine. It's as if the import only works when it is in the original location. Basically, git and posh-git are the only things I really use Powershell for at the present time. Am I misunderstanding the instructions? What am I missing?
Microsoft.PowerShell_profile.txt <--my current non-working profile
The text was updated successfully, but these errors were encountered: