What can you do?
You saw in the previous chapter that you are able to run standard command-line programs in PowerShell and that there are aliases defined for some cmdlets that allow you to use the names of commands that you are used to from other shells. Other than these, what can you use? How do you know which commands, cmdlets, and aliases are available?
The answer is the first of the big three cmdlets, the Get-Command
cmdlet. Simply executing Get-Command
with no parameters displays a list of all the entities that PowerShell considers to be executable. This includes programs in the path (the environment variable), cmdlets, functions, scripts, and aliases.
This list of commands is long and gets longer with each new operating system and PowerShell release. To count the output, we can use this command:
Get-Command | Measure-Object
The output of this command is as follows:
Tip
The pipe character (|
) tells PowerShell to use the output of the command on the left of the pipe as the input of the...