Powershell to configure github

I just installed GitHub for windows, and for convenience, I added entries for powershell to the context menu in Windows Explorer. Registry Commands:

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 .ps1 profile to get poshgit and other settings in my powershell environment. However, it does not work completely. I see that shell.ps1 has been executed (when I start $ env: github_posh_git, I see the correct value), but when I go to git reposition, I donโ€™t see the extended prompt.

What am I missing?

PS : the only version of Powershell with which I came with GitHub for Windows, and although the folder says "1.0", executing

  $psversiontable.psversion 

came back

 Major Minor Build Revision ----- ----- ----- -------- 2 0 -1 -1 
+6
source share
1 answer

I got a response from GitHub support:

An extended prompt is provided by posh-git [1], and it is not added when a line is run in shell.ps1. However, it is quite easy to install.

Just connect to C: \ Users \ Username \ AppData \ GitHub \ PoshGit_ * and run the install.ps1 script from PowerShell. It will automatically add it to your PowerShell $ profile.

+4
source

Source: https://habr.com/ru/post/951608/


All Articles