Stop prompt from being bold
This commit is contained in:
parent
9c4ec603e6
commit
261be6f601
1 changed files with 4 additions and 11 deletions
|
@ -5,23 +5,16 @@
|
||||||
|
|
||||||
function Prompt {
|
function Prompt {
|
||||||
if ($IsWindows -or ($env:OS -eq "Windows_NT")) {
|
if ($IsWindows -or ($env:OS -eq "Windows_NT")) {
|
||||||
[string]$monoPrompt = ""
|
|
||||||
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
|
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
|
||||||
if ($currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
|
if ($currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
|
||||||
$monoPrompt = $env:USERNAME + "@" + $env:COMPUTERNAME.ToLower() + "# "
|
return "${env:USERNAME}@$(${env:COMPUTERNAME}.ToLower())# "
|
||||||
} else {
|
} else {
|
||||||
$monoPrompt = $env:USERNAME + "@" + $env:COMPUTERNAME.ToLower() + "> "
|
return "${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
|
|
||||||
}
|
}
|
||||||
} elseif ($IsLinux) {
|
} elseif ($IsLinux) {
|
||||||
"`e[1m" + $(id -un) + "@" + $(hostname -s) + "> `e[0m"
|
return "$(id -un)@$(hostname -s)> "
|
||||||
} else {
|
} else {
|
||||||
"PS> "
|
return "PS> "
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue