24/7/365 Support

Customize the Windows Shell to Improve Your Productivity

Problem

You want to use the PowerShell console more efficiently for copying, pasting, history management, and scrolling.

Solution

Shell console windows and make many tasks easier.

Example 18. SetConsoleProperties.ps1

PushLocation SetLocation HKCU:\Console NewItem '.\%SystemRoot%_system32_WindowsPowerShell_v1.0_powershell.exe' SetLocation '.\%SystemRoot%_system32_WindowsPowerShell_v1.0_powershell.exe'

NewItemProperty . ColorTable00 type DWORD value 0x00562401 NewItemProperty . ColorTable07 type DWORD value 0x00f0edee NewItemProperty . FaceName type STRING value "Lucida Console" NewItemProperty . FontFamily type DWORD value 0x00000036 NewItemProperty . FontSize type DWORD value 0x000c0000 NewItemProperty . FontWeight type DWORD value 0x00000190 NewItemProperty . HistoryNoDup type DWORD value 0x00000000 NewItemProperty . QuickEdit type DWORD value 0x00000001 NewItemProperty . ScreenBufferSize type DWORD value 0x0bb80078 NewItemProperty . WindowSize type DWORD value 0x00320078 PopLocation

These commands customize the console color, font, history storage properties, QuickEdit mode, buffer size, and window size.

With these changes in place, you can also improve your productivity by learning some of the hotkeys for common tasks, as listed in Table 11. PowerShell uses the same input facilities as cmd.exe, and so brings with it all the input features that you are already familiar with—and some that you aren’t!

Table 11. Partial list of Windows PowerShell hotkeys

Hotkey
Meaning

Up arrow
Scan backward through your command history.

Down arrow
Scan forward through your command history.

PgUp
Display the first command in your command history.

PgDown
Display the last command in your command history.

Left arrow
Move cursor one character to the left on your command line.

Right arrow
Move cursor one character to the right on your command line.

Home
Move the cursor to the beginning of the command line.

End
Move the cursor to the end of the command line.

Control + Left arrow
Move the cursor one word to the left on your command line.

Control + Right arrow
Move the cursor one word to the right on your command line.

Discussion

When you launch PowerShell from the link on your Windows Start menu, it customizes several aspects of the console window:

  • Foreground and background color, to make the console more visually appealing
  • QuickEdit mode, to make copying and pasting with the mouse easier
  • Buffer size, to make PowerShell retain the output of more commands in your console history

By default, these customizations do not apply when you run PowerShell from the Start ➝ Run dialog. The commands given in the solution section improve the experience by applying these changes to all PowerShell windows that you open.

The hotkeys do, however, apply to all PowerShell windows (and any other application that uses Windows’ cooked input mode). The most common are given in the in the solution section, but “Common Customization Points”.

Help Category:

Get Windows Dedicated Server

Only reading will not help you, you have to practice it! So get it now.

Processor RAM Storage Server Detail
Intel Atom C2350 1.7 GHz 2c/2t 4 GB DDR3 1× 1 TB (HDD SATA) Configure Server
Intel Atom C2350 1.7 GHz 2c/2t 4 GB DDR3 1× 128 GB (SSD SATA) Configure Server
Intel Atom C2750 2.4 GHz 8c/8t 8 GB DDR3 1× 1 TB (HDD SATA) Configure Server
Intel Xeon E3-1230 v2 3.3 GHz 4c/8t 16 GB DDR3 1× 256 GB (SSD SATA) Configure Server
Intel Atom C2350 1.7 GHz 2c/2t 4 GB DDR3 1× 250 GB (SSD SATA) Configure Server

What Our Clients Say