1.3. Finding Available Commands

In this section, I will show you a few commonly used commands and show you how to explore the PowerShell cmdlets to see what PowerShell commands are available on your system. The get-command cmdlet allows you to explore the commands available to you in Windows PowerShell.

The simplest, but not the most useful, way to use the get-command cmdlet is simply to type:

get-command

at the PowerShell command line. Several screens of command names scroll past when you do this— there are a lot of cmdlets in PowerShell. It's more useful to view the information one screen at a time. You achieve that by typing:

get-command | More

at the PowerShell command line. The result is similar to that shown in Figure 1-11. If you run that command and carefully read the available commands, you will get some idea of the scope of functionality that PowerShell allows you to control and manage.

Figure 1.11. Figure 1-11

To view another screen of commands, press the spacebar once. Repeat this to view each additional screen of commands.

NOTE

PowerShell commands are formed of a verb, followed by a hyphen (or minus sign), followed by a noun. The get-command cmdlet illustrates the structure. The verb "get" is followed by a hyphen, which is followed by a noun "command". PowerShell uses the singular form of the noun, even when, as is often the case, you want to find multiple items ...

Get Professional Windows® PowerShell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.