Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save svens/f128a988d2e74f5a565dd467f08f2aa3 to your computer and use it in GitHub Desktop.
Save svens/f128a988d2e74f5a565dd467f08f2aa3 to your computer and use it in GitHub Desktop.
Powershell setup
# general settings
Set-PSReadlineOption -EditMode Emacs
function Prompt
{
$identity = [Security.Principal.WindowsIdentity]::GetCurrent()
$principal = [Security.Principal.WindowsPrincipal] $identity
if ($principal.IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
Write-Host "$(Get-Location)" -NoNewLine -ForegroundColor Red
return " # "
}
Write-Host "$(Get-Location)" -NoNewLine -ForegroundColor Green
return " `$ "
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment