February 21st, 2014

PowerTip: Personalize Your Copy of PowerShell

Doctor Scripto
Scripter

Summary: Easily add your user name to your Windows PowerShell console window.

Hey, Scripting Guy! Question I often start multiple Windows PowerShell consoles with different credentials.
          To avoid getting confused, how can I change the window title to my user name?

Hey, Scripting Guy! Answer Use the $host automatic variable, and change the WindowTitle property to the user name:

$host.ui.RawUI.WindowTitle = $env:USERNAME

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

Feedback