-
Notifications
You must be signed in to change notification settings - Fork 0
/
Microsoft.VSCode_profile.ps1
26 lines (20 loc) · 1.12 KB
/
Microsoft.VSCode_profile.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
26
function prompt {
$Date = Get-Date -Format 'hh:mm:ss tt'
# Test for Admin / Elevated
$IsAdmin = (New-Object Security.Principal.WindowsPrincipal ([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
$GitPromptSettings.EnableWindowTitle = $null
#Decorate the CMD Prompt
Write-Host ""
Write-Host ($(if ($IsAdmin) { 'Elevated ' } else { '' })) -BackgroundColor DarkRed -ForegroundColor White -NoNewline
Write-Host " $env:USERNAME@$env:COMPUTERNAME " -BackgroundColor DarkBlue -ForegroundColor White -NoNewline
Write-Host " $pwd " -ForegroundColor White -BackgroundColor DarkGreen -NoNewline
Write-Host " [$date] " -ForegroundColor White
return "$(Write-VcsStatus) => "
}
Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
Set-PSReadLineOption -PredictionSource History
Write-Host 'importing posh-git' -ForegroundColor Yellow
Import-Module posh-git
Write-Host