Skip to content

Instantly share code, notes, and snippets.

View jbirley's full-sized avatar
🏠
Working from home

Jim Birley jbirley

🏠
Working from home
View GitHub Profile
@mattifestation
mattifestation / profile.ps1
Created March 28, 2020 22:16
PowerShell profile to add some functionality for Windows Terminal
# Personal preference. I like landing on the Desktop
Set-Location $Env:USERPROFILE\Desktop
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
# If the current session is elevated, prefix the prompt with '[Admin]'
if ($currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Set-Item -Path Function:\prompt -Value "`"[Admin] PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) `""
}