PowerTip: Change the PowerShell Console Title


Summary: Learn how to change the Windows PowerShell console title.

Hey, Scripting Guy! Question How can I change the title of the Windows PowerShell console?

Hey, Scripting Guy! Answer One way to do this is to use the WindowTitle property from $host.ui.rawui, as shown here.

$host.ui.RawUI.WindowTitle = "Changed Title"

Comments (6)

  1. dude says:

    This should be a cmdlet!

    Cool.

  2. Chris King says:

    I guess I want to change it after the console is open. For example, when I connect to Azure, I want to indicate that in the title bar. This command does not error out but it does not change the value either.

  3. Travis says:

    function change-title {
    param ( [string] $newtitle)
    $host.ui.RawUI.WindowTitle = $newtitle + " – " + $host.ui.RawUI.WindowTitle;
    }

    not a cmdlet, but quick and easy function

  4. Pankaj G says:

    $host.ui.RawUI.WindowTitle = "Changed Title" – > fantastic it worked for me , thnx a lot 🙂

  5. nlapjr says:

    Thanks. This tip also worked for me. Just one question. How do you make this permanent?

  6. PC says:

    @ nlapjr

    Sorry for the late command, but you can make the changes permanent by adding it to your Powershell Profile. You can discover this file from Powershell by just entering the statement $profile from the shell command line.

    I recommend the following regarding the $profile variable.
    https://blogs.technet.microsoft.com/heyscriptingguy/2012/05/21/understanding-the-six-powershell-profiles/

    Cheers
    PC

Skip to main content