How to I set the title of my Console Window?

How to I set the title of my Console Window?

  • Comments 6

PSMDTAG:FAQ: How do I set the title of my console window?  ANSWER: $Host.UI.RawUI.WindowTitle = "PowerShell ROCKS"

Jeffrey Snover [MSFT]
Windows PowerShell/Aspen Architect
Visit the Windows PowerShell Team blog at:    http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at:  http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

Leave a Comment
  • Please add 8 and 5 and type the answer here:
  • Post
  • The PowerShell team's blog posted this great script on their blog today.
    http://blogs.msdn.com/powershell/archive/2006/07/17/How_to_I_set_the_title_of_my_Console_Window.aspx...
  • nice.

    now what if you want that change to be persisted across sessions?

    similarly, what if i want to change the prompt function, and then have it retain this new value next time i open a powershell console?

  • Find profile.ps1 (can't recall where it lives) and add that line to your prompt function.  Make any additional changes, then save and restart powershell.
  • default Profile files reside in
    $ALLUSERSPROFILE\Documents\PSConfiguration\
  • thank you eric and thank you monadblog person.

    asking questions on other peoples blogs is so much easier than just reading the help documentation myself. ;-)
  • The location of the profile is stored in $profile so you can use that (i have an alias that does nothing more than gvim $profile).

    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.

    More elaborate prompt functions are certainly possible, of course - for example http://mshforfun.blogspot.com/2006/05/perfect-prompt-for-windows-powershell.html
Page 1 of 1 (6 items)