Created
October 6, 2025 06:03
-
-
Save koreapyj/d5f1d0cbc0432aa36f2444f1a7aa3123 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function which { | |
(Get-Command $args).Source | |
} | |
function whoami { | |
echo $Env:UserName | |
} | |
function prompt { | |
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) | |
Write-Host -NoNewline "$Env:username@$Env:computername" -ForegroundColor Green | |
Write-Host -NoNewline ":" | |
Write-Host -NoNewline -ForegroundColor Blue ("$PWD".StartsWith("$HOME") ? ("~"+"$PWD".Substring("$HOME".Length)) : ("$PWD".StartsWith("C:\") ? "$PWD".Substring(2) : $PWD)) | |
Write-Host -NoNewline ($currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) ? "#" : "$") | |
return " " | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment