From 261be6f6017205199aa4d7e7aca2c917ac200526 Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Fri, 15 Sep 2023 11:37:12 +0100 Subject: [PATCH] Stop prompt from being bold --- .../files/Microsoft.PowerShell_profile.ps1 | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/roles/home-cli/files/Microsoft.PowerShell_profile.ps1 b/roles/home-cli/files/Microsoft.PowerShell_profile.ps1 index 6964856..f7a95a3 100644 --- a/roles/home-cli/files/Microsoft.PowerShell_profile.ps1 +++ b/roles/home-cli/files/Microsoft.PowerShell_profile.ps1 @@ -5,23 +5,16 @@ function Prompt { if ($IsWindows -or ($env:OS -eq "Windows_NT")) { - [string]$monoPrompt = "" $currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) if ($currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { - $monoPrompt = $env:USERNAME + "@" + $env:COMPUTERNAME.ToLower() + "# " + return "${env:USERNAME}@$(${env:COMPUTERNAME}.ToLower())# " } else { - $monoPrompt = $env:USERNAME + "@" + $env:COMPUTERNAME.ToLower() + "> " - } - if ($PSVersionTable.PSVersion -ge [System.Version]"6.0.0.0") { - # Print the prompt in bold. - "`e[1m" + $monoPrompt + "`e[0m" - } else { - $monoPrompt + return "${env:USERNAME}@$(${env:COMPUTERNAME}.ToLower())> " } } elseif ($IsLinux) { - "`e[1m" + $(id -un) + "@" + $(hostname -s) + "> `e[0m" + return "$(id -un)@$(hostname -s)> " } else { - "PS> " + return "PS> " } }