1.5. Basic Housekeeping
On the surface, a lot of PowerShell works in the same way as CMD.exe. In this section, I describe a couple of basic commands that you will likely use frequently.
To clear the screen, you can type:
clear-host
or:
clear
or:
cls
at the PowerShell command line.
To repeat the last-used PowerShell command, press the F3 key once.
To cycle through recently used PowerShell commands, press the up arrow as necessary to move back to the command that you want to reuse or to adapt. You can also use the get-history cmdlet to see the command history. By default, you will be able to see the last 64 commands, but if you or an administrator has modified the value of the $MaximumHistoryCount variable, the number of commands available in the history may differ.
At the risk of stating the obvious, PowerShell offers you a number of ways to review information that has scrolled out of sight by using the scroll bars in the PowerShell command window. Click in the scroll bar area or drag the slider in the scroll bar area to move up and down through the information in the PowerShell console window.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access