15

I have many PowerShell windows open, with a command history specific for a task.

In the good old Batch file days I would use Title finance dpt or Title Email Admin. How can I accomplish this in PS?

makerofthings7
  • 8,911
  • 34
  • 121
  • 197
  • @buzz3791 The UserVoice.com link in comment from '18 is no longer available. Can you delete the comment? We can't edit your comment. – yzorg Aug 04 '21 at 12:55

4 Answers4

21
PS C:\> $Host.UI.RawUI.WindowTitle = "New Window Title"

You can also throw this in your profile if it's something you want on each new PS window.

Check out the TechNet article Customizing the Windows PowerShell Console

jscott
  • 24,484
  • 8
  • 79
  • 100
1

If you want to set the title when you spawn a process:

$StartInfo = new-object System.Diagnostics.ProcessStartInfo
$StartInfo.FileName = "$pshome\powershell.exe"
$StartInfo.Arguments = "-NoExit -Command `$Host.UI.RawUI.WindowTitle=`'Your Title Here`'"
[System.Diagnostics.Process]::Start($StartInfo)
Lou O.
  • 11
  • 1
1

The simplest way of doing this is to use the following command in the PowerShell window:-

$host.ui.RawUI.WindowTitle = 'Some Name'

You can also use the following command in the Command prompt(cmd) or RunAs Dialog Box for getting the PowerShell Window with desired Title in the traditional CMD styled window.

cmd /k PowerShell -NoExit -Command "& {$host.ui.RawUI.WindowTitle = 'Powershell'}"

P.S: Its like traditional CMD with PowerShell features and Syntax Highlighting.

AbhiAbzs
  • 21
  • 4
0

If its your own console you wnat to customise then the following article at how-to-geek has the detail you need. Quite a few steps but worth it.