forked from shanselman/PowerShellHgGit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprompt.ps1
26 lines (19 loc) · 777 Bytes
/
prompt.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$defaultPromptHash = "HEYStcKFSSj9jrfqnb9f+A=="
$md5 = [Security.Cryptography.MD5]::Create()
$thePrompt = [Text.Encoding]::Unicode.GetBytes((Get-Command prompt | Select-Object -ExpandProperty Definition))
$thePromptHash = [Convert]::ToBase64String($md5.ComputeHash($thePrompt))
if ($thePromptHash -eq $defaultPromptHash) #using the default prompt?
{
#recommend our own
function prompt(){
# Reset color, which can be messed up by Enable-GitColors
$Host.UI.RawUI.ForegroundColor = $GitPromptSettings.DefaultForegroundColor
Write-Host($pwd) -nonewline -foregroundcolor white
Write-VcsStatus
Write-Host ""
return "$ "
}
}
else {
Write-Debug "Make sure your prompt includes a called to Write-VcsStatus!"
}