- Run PowerShell.
- Type the following to get the profile folder location:
echo $PROFILE
. NOTE: if you want to make a change beyond just the local user and system, use one of the parameters here. - Create a file in this location, it it doesn’t exist.
- In this file, enter the following:
function prompt { $branch = git branch --show-current if ($LASTEXITCODE -ne 0) { "PS $(Get-Location)>" return } "PS $(Get-Location) (git:$branch)" }
- Go to a folder with a git repository, and verify that the current branch is shown.