Last active
September 13, 2018 10:33
-
-
Save svens/f128a988d2e74f5a565dd467f08f2aa3 to your computer and use it in GitHub Desktop.
Powershell setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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