Created
April 1, 2018 13:28
-
-
Save HerbM/abd73225cb2dd796350623a928b51e74 to your computer and use it in GitHub Desktop.
Old Prompt (2018 Mar 30)
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 Global:prompt { | |
If (!(Get-Variable MaxPrompt -ea 0 2>$Null)) { $MaxPrompt = 45 } | |
$loc = "$($executionContext.SessionState.Path.CurrentLocation)" | |
$Sig = " |>$('>' * $nestedPromptLevel)" | |
if ($Global:MaxPromptLength) { | |
$LocLen = $Loc.length; $SigLen = $Sig.Length | |
$Length = $LocLen + $SigLen | |
$Excess = $Length - $Global:MaxPromptLength | |
If ($Excess -gt 0) { | |
$Excess = [Math]::Min($Excess, $LocLen) | |
} | |
} | |
write-host -nonewline "'$Loc'$Sig" -fore Cyan -back DarkGray | |
' ' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment