Skip to content

Commit a17eb35

Browse files
author
Klaus Frank
authored
Add Update PowerShell Prompt section
Add Update PowerShell Prompt section
1 parent 14cdda0 commit a17eb35

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

book/A-git-in-other-environments/sections/powershell.asc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,20 @@ More information about the requirements: (https://docs.microsoft.com/en-us/power
3232
-----
3333
If you want to install Posh-Git only for the currnet user and not globaly, use "-Scope CurrentUser" instead.
3434

35+
===== Update PowerShell Prompt
36+
To include git information in your prompt, posh-git needs to be imported. To do this automatically, include the import statement into you $profile script. This script is executed everytime you open a new PowerShell prompt.
37+
Keep in mind, that there are multiple $profile scripts. E. g. one for the console and a separate one for the ISE.
38+
[source,powershell]
39+
-----
40+
> 'Import-Module Posh-Git' | Out-File -Append -Encoding default -FilePath $profile
41+
-----
42+
3543
===== From Source
3644
Just download a Posh-Git release from (https://github.com/dahlbyk/posh-git[]), and uncompress it to the `WindowsPowershell` directory.
3745
Then open a Powershell prompt as an administrator, and do this:
3846
[source,powershell]
3947
-----
40-
> cd ~\Documents\WindowsPowerShell\posh-git
48+
> cd ~\Documents\WindowsPowerShell\Module\posh-git
4149
> .\install.ps1
4250
-----
4351

0 commit comments

Comments
 (0)