
How it works…
It is inconvenient to leave your Terminal to read Help online. We would prefer to have all of the Help available locally. PowerShell can potentially work on low-memory devices such as Raspberry, but saving all of the Help in the limited space we have is not advisable. This is one of the reasons PowerShell comes with minimal Help by default. The reason updating Help requires elevated privileges is that the Help information is stored within the shell. Therefore, non-administrators may not be able to update Help without administrator intervention.
As a general practice, cmdlets come pre-packaged with Help information, and Get-Help works like the man command in Linux. The output of Get-Help has the name of the cmdlet, the syntax to use with the cmdlet, the alias(es) available for the cmdlet and more online Help if required. -Full and -Examples are (mutually exclusive) switches that tell PowerShell about the level of Help you need.
The groups of parameters, as seen in the case of Get-Command, under SYNTAX, are called parameter sets. They tell us which parameters can be used together. Parameters not appearing in the same parameter set cannot be used together. For example, you cannot use -Noun and -Name with Get-Command at the same time; it wouldn't be logical to do so.
If the Help information seems elaborate, and you would like to learn about a specific parameter of a cmdlet, you can specify that parameter, and the Help will be filtered accordingly. Since the output of most PowerShell cmdlets is objects, it is easy to select the necessary object and discard the rest from the output. Also note that this is the recommended approach to fetch Help that's specific to a certain parameter.
Next, let's talk about searching Help for specific keywords. PowerShell outputs objects. However, at the end, when the content comes to the host, the content can be processed by Linux commands such as grep. Therefore, to search Help for specific keywords, you could always pipe the output to grep. If you would like to go the PowerShell way (especially if you go by the write once, run everywhere philosophy), this requires minor modifications. First, we fetch the Help; the output is an object (so that it can be processed further if needed). We convert this into a string using Out-String, since search is nothing but string matching.
PowerShell cmdlets output single or multiple instances of objects (we will discuss objects in more detail in the Understanding objects recipe). Out-String waits for all of the Get-Help commands to be processed and converts the output into a single concatenated string. To break the string into chunks, we use the -Stream switch, which instructs Out-String to not concatenate the output. This way, each paragraph is processed separately. Next, we use the Select-String cmdlet, along with the search keyword to perform keyword matching. The output of this is the chunk (paragraph, in this case) with the keyword.