Created
January 2, 2016 19:23
-
-
Save sweeneyrobb/e9f17f145bb256770f7a to your computer and use it in GitHub Desktop.
Tweaks the prompt so that when your working directory appears in the $prompts hash table it will replace it with a designated string (the value of the hash table). Makes working with long paths a little bit more bearable without reducing the path too much. Add to $PROFILE to use without pasting every time.
This file contains 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 prompt() { | |
$prompts = @{ | |
$HOME = "~"; | |
"$HOME\Documents\GitHub" = "~\[github]"; | |
$env:windir = "windir"; | |
} | |
$loc = (Get-Location | Select -ExpandProperty Path) | |
$prompts.GetEnumerator() | ForEach-Object { $loc = $loc.Replace($_.Name, $_.Value) } | |
return $loc + "> " | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment