Skip to content

Instantly share code, notes, and snippets.

@schlarpc
Created June 16, 2014 14:02
Show Gist options
  • Save schlarpc/02cf9a2543f7f1df596b to your computer and use it in GitHub Desktop.
Save schlarpc/02cf9a2543f7f1df596b to your computer and use it in GitHub Desktop.
PowerShell prompt
(Get-Host).UI.RawUI.WindowTitle = "Windows PowerShell"
function Get-DirAlias ([string]$loc) {
return $loc.Replace($env:homedrive + $env:homepath, "~")
}
function prompt {
Write-Host "$env:username@$env:computername" -NoNewLine -ForegroundColor Green
Write-Host ":" -NoNewLine
Write-Host "$(Get-DirAlias($(Get-Location)))" -NoNewLine -ForegroundColor Cyan
return "$ "
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment