From 44098ee021b941732e6f276f82669e497cf23044 Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Fri, 1 Mar 2024 20:22:24 +0000 Subject: [PATCH] Make username all lower case in PowerShell prompt --- profile.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/profile.ps1 b/profile.ps1 index 79c2506..de501cd 100644 --- a/profile.ps1 +++ b/profile.ps1 @@ -36,10 +36,11 @@ function Prompt { $identity = [Security.Principal.WindowsIdentity]::GetCurrent() $principal = [Security.Principal.WindowsPrincipal] $identity $adminRole = [Security.Principal.WindowsBuiltInRole]::Administrator + $userName = $Env:USERNAME.ToLower() if($principal.IsInRole($adminRole)) { - $Env:USERNAME | Write-Host -ForegroundColor DarkRed -NoNewline + $userName | Write-Host -ForegroundColor DarkRed -NoNewline } else { - $Env:USERNAME | Write-Host -ForegroundColor DarkGreen -NoNewline + $userName | Write-Host -ForegroundColor DarkGreen -NoNewline } return ' ' }