Datasheet
UNDERSTAND THE BASICS OF POWERSHELL 7
Administering
Service Delivery
PART I
You can use the right arrow key to retype the previous command one character at
a time. You also have the option of accessing a list of the previous 50 commands by
pressing the F7 key, as shown in Figure 1.3. Navigate through this list by using the
arrow keys and pressing Enter on the command you want to execute, or type the
command number that you want to execute and press F9. To close the list without
executing a command, press the Esc key.
FIGURE 1.3 PowerShell command history
One of the lesser-known customizations of PowerShell is the ability to change
the look at and feel of the shell itself. You can do this via the
Get-Host
cmdlet in
PowerShell (more on cmdlets later in this chapter). You modify certain components
of the shell by changing the properties in the console. For example, to change the
text color to green, you can use the following command:
(Get-Host).UI.RawUI.ForegroundColor = “Green”
Table 1.1 outlines some properties that you may want to change in the console.
TABLE 1.1 Console Properties
Property Description Example Command
ForegroundColor
The color of the text
(Get-Host).UI.RawUI i
.ForegroundColor = “Green”
BackgroundColor
The color of the background
(Get-Host).UI.RawUI i
.BackgroundColor = “Black”
WindowTitle
The text that is displayed in the
title bar of the PowerShell window
(Get-Host).UI.RawUI.WindowTitle i
= “Ken’s PowerShell Window”
c01.indd 7c01.indd 7 5/12/2011 1:07:41 PM5/12/2011 1:07:41 PM