Skip to content

Instantly share code, notes, and snippets.

@Ang3lFir3
Created September 23, 2010 20:31
Show Gist options
  • Save Ang3lFir3/594301 to your computer and use it in GitHub Desktop.
Save Ang3lFir3/594301 to your computer and use it in GitHub Desktop.
function prompt {
$path = (Get-Location).Path
if ($path.Length -gt 45)
{
$path = Get-Prompt($path);
}
"$path>"
}
function Get-Prompt([string] $path)
{
$loc = "";
$tokens = $path.Split('\');
for ($i = 0; $i -lt $tokens.Count -1; $i++)
{
$loc += $tokens[$i][0] + '\';
}
$loc += $tokens[$tokens.count -1]
return $loc.ToUpper();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment