One of the problems with having multiple command shells open at the same time is figuring out which window does what. After all, they all look the same, right Well, not necessarily. You can use a few handly tricks to make different windows more distinguishable.
:: Change the background and foreground colours.
:: Change the Windows size
:: Change the windows title
Adding colour to your world
You can easily change the background and foreground colors to suit your
preference. For example, you can change the background color to magenta
and the foreground color (the color the text is displayed in) to blue by typing
these commands at the PSH prompt.
$Host.UI.RawUI.BackgroundColor=”magenta”
$Host.UI.RawUI.ForegroundColor=”blue”
$Host is a special variable that is a reference to the current console object.
You assign the appropriate color to the UI.RawUI.BackgroundColor and UI.RawUI.ForegroundColor properties of the console object.
Getting size-specific with your windows
The $Host.UI.RawUI object is actually pretty useful. You can query or manipulate additional properties through this object to affect the console’s appearance besides the foreground and background colors. You can change the window size, the buffer size, and even change the window’s title. (The following section covers how to change the title.)
The buffer size is the width and height of the window retained in memory where as the window size is the portion of the buffer that’s visible. Because of this, the only real constraint is that your window size must be smaller than your buffer size. (PSH won’t let you screw this up even if you try.) The buffer height is important because it controls essentially how far back you can scroll in your window as you run more and more commands. The default buffer height is 3,000, which means the buffer keeps up to 3,000 lines of output before it starts to discard older entries.
You change the window or buffer size by changing the value of either the BufferSize or WindowSize property of $Host.UI.RawUI. If you want to find out the current value, run the following PSH commands:
$Host.UI.RawUI.BufferSize
$Host.UI.RawUI.WindowSize
The output of either command is the width and height displayed in a tabular format. Now, you might be tempted to try something like this to change the window size:
$Host.UI.RawUI.WindowSize.Width = 110
$Host.UI.RawUI.WindowSize.Height = 40
Although PSH doesn’t complain, the window size doesn’t change, and if you query the value of WindowSize again, you’ll find that the old values are still there. The correct way to change WindowSize is by assigning a new value to this property directly. Because WindowSize is an object, you need to somehow create an object of that type, set its width and height properties, then assign this new value to WindowSize. You can change the window size by using the following command sequence:
$size = $Host.UI.RawUI.WindowSize
$size.Width = 100
$size.Height = 25
$Host.UI.RawUI.WindowSize = $size
Here I store the value of WindowSize in a variable called $size. I don’t really care so much about what the current value is, but I need to have an object that’s the same data type as WindowSize so I can make the change.
Now that I have such an object, I assign my new width and height values to it and then reassign this entire object back to WindowSize. If you want to change the buffer size, simply replace WindowSize with BufferSize.
Window and buffer width and height dimensions aren’t measured in pixels —
rather, width is measured by the number of characters that fit on one row, and height refers to the number of rows it can accommodate.
Reference - CookBook Powershell