CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Language: PowerShell

Powershell Current Path In Command Prompt Title

563 Views
Copy Code Show/Hide Line Numbers
$isAdmin = !(($env:SESSIONNAME).Length -gt 0)
 
function Prompt
{
  if ($isAdmin)
  {
    $host.ui.RawUI.WindowTitle = '[Admin] ' + $(get-location)
    "#>"
  }
  else
  {
    $host.ui.RawUI.WindowTitle = $(get-location)
    "$>"
  }
}
by Andy Sherwood
  September 10, 2009 @ 3:11pm
Tags:
Description:
Put that in your profile.ps1 file

by Matthew Flaschen    October 18, 2011 @ 6:10pm

I posted a modified version of this at http://codepaste.net/4b5eir . It keeps the working directory in the prompt as well.

Add a comment


Report Abuse
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate