I just installed GitHub for windows and for convenience I added entries for the powershell in the context menu in Windows Explorer. The registry commands are:
C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -NoExit
C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -Command Set-Location -LiteralPath '%L'
As suggested in shell.ps1 I added ". (Resolve-Path "$env:LOCALAPPDATA\GitHub\shell.ps1")" to my profile.ps1 to get poshgit and the rest setup within my powershell environment. It is not completely working though. I can see that shell.ps1 was executed (when running "$env:github_posh_git" I see the right value appearing) but when I navigate to a git repo I do not see the enhanced prompt.
What am I missing?
PS: The only version of Powershell I have came with GitHub for windows and even though the folder says "1.0" running
$psversiontable.psversion
returned
Major Minor Build Revision
----- ----- ----- --------
2 0 -1 -1
I got an answer from GitHub support:
The enhanced prompt is provided by posh-git [1], and it isn't added when you run the line in shell.ps1. However, it's easy enough to install.
Just cd to C:\Users\Username\AppData\GitHub\PoshGit_* and run the install.ps1 script from PowerShell. It will add it to your PowerShell $profile automatically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With