Powershell for GitHub setup
Asked Answered
C

1

6

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
Chiquita answered 13/8, 2013 at 8:30 Comment(3)
Ignore the name of the folder. It still says v1.0 for PowerShell v3 and the v4 preview.Laszlo
Where have you placed your profile.ps1 file? It should be in $Home\Documents\WindowsPowerShell.Laszlo
@KeithHill The profile.ps1 file is where you mentioned.Chiquita
C
4

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.

Chiquita answered 14/8, 2013 at 8:23 Comment(1)
Depending on network config, you may have to cd to "C:\Users\Username\AppData\local\GitHub\PoshGit_*"Pandybat

© 2022 - 2024 — McMap. All rights reserved.