function prompt {
$realLASTEXITCODE = $LASTEXITCODE
Write-Host
Write-Host "$ENV:USERNAME@" -NoNewline -ForegroundColor DarkYellow
Write-Host "$ENV:COMPUTERNAME" -NoNewline -ForegroundColor Magenta
if ($s -ne $null) { # color for PSSessions
Write-Host " (`$s: " -NoNewline -ForegroundColor DarkGray
Write-Host "$($s.Name)" -NoNewline -ForegroundColor Yellow
Write-Host ") " -NoNewline -ForegroundColor DarkGray
}
Write-Host " : " -NoNewline -ForegroundColor DarkGray
Write-Host $($(Get-Location) -replace ($env:USERPROFILE).Replace('\','\\'), "~") -NoNewline -ForegroundColor Blue
Write-Host " : " -NoNewline -ForegroundColor DarkGray
Write-Host (Get-Date -Format G) -NoNewline -ForegroundColor DarkMagenta
Write-Host " : " -NoNewline -ForegroundColor DarkGray
$global:LASTEXITCODE = $realLASTEXITCODE
Write-VcsStatus
Write-Host ""
return "> "
}
Created
October 3, 2019 15:16
-
-
Save emaldonadot/83ef18b1f8415be86b6515cf6df029ef to your computer and use it in GitHub Desktop.
Make PowerShell look better
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment