Setting the console title to be your current working directory

PowerShell Team

jmanning wrote:

Also, given how common the request is, I’d ask Jeffrey to (pretty-please) also include in this post a prompt function that sets the title to include pwd.

Ask and yea shall receive:

function Prompt
  $host.ui.RawUI.WindowTitle = $(get-location)
  “PS> “

If you want to see a bunch of great prompt examples, check out:

Jeffrey Snover [MSFT]
Windows PowerShell/Aspen Architect
Visit the Windows PowerShell Team blog at:
Visit the Windows PowerShell ScriptCenter at:


PSMDTAG:FAQ:  How do I set the Console Title to my current working directory?