≡ Menu

Customizing PowerShell Command prompt window

Powershell allows you to customize it’s command prompt window. You can,  set color of your choice from below list for foreground and back ground, set Windows Title,  Set buffer size,  Cursor size, etc.

Colors List : Black, Blue, DarkBlue, Cyan, DarkCyan, Gray, DarkGray, Green, DarkGreen, Magenta, DarkMagenta, Red, DarkRed, White, Yellow and DarkYellow.

Below examples will give a brief of how to customize some of the parameters.

Set background color 

$host.UI.rawui.foregroundcolor = “yellow” 

Set foreground color 

$host.UI.rawui.foregroundcolor = “<your_color” 

Set Window Title 

$host.UI.rawui.windowtitle = “My PowerShell Window”

Set Error Background Color

$host.Privatedata.ErrorBackGroundColor = “<your_color>”

Set Warning background color

$host.Privatedata.WarningBackgroundColor = “<your_color>”

Similarly, you can set DebugBackgroundColor, DebugForegroundColor, ErrorBackgroundColor, ErrorForegroundColor, ProgressBackgroundColor, ProgressForegroundColor, VerboseBackgroundColor, VerboseForegroundColor, WarningBackgroundColor, WarningForegroundColor

See the output of below command to know more about it.

$host.Provatedata | gm

Do you have any other customizations in mind? Do let me know by commenting here…