Welcome to MSDN Blogs Sign in | Join | Help

How to I set the title of my Console Window?

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

Published Monday, July 17, 2006 7:18 PM by PowerShellTeam
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# How to set the title of my Console Window

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...
Monday, July 17, 2006 4:49 PM by Ron Crumbaker at myITforum.com, Inc.

# re: How to I set the title of my Console Window?

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?

Tuesday, July 18, 2006 3:45 AM by lb

# re: How to I set the title of my Console Window?

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.
Tuesday, July 18, 2006 10:50 AM by Eric

# re: How to I set the title of my Console Window?

default Profile files reside in
$ALLUSERSPROFILE\Documents\PSConfiguration\
Tuesday, July 18, 2006 1:43 PM by dontBotherMeWithSpam

# re: How to I set the title of my Console Window?

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. ;-)
Tuesday, July 18, 2006 7:35 PM by lb

# re: How to I set the title of my Console Window?

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
Friday, July 21, 2006 2:57 AM by jmanning

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker