Discover commands in PowerShell Flashcards
Discover cmdlets by using the help system and Get-Help
You can use the Get-Help core cmdlet to learn more about a command. Typically, you invoke Get-Help by specifying it by name and adding the -Name flag that contains the name of the cmdlet you want to learn about. Here’s an example:
Get-Help -Name Get-Help
Update help
New versions of PowerShell don’t include the help system by default. The first time you run Get-Help, you’re asked to install the help files. You can also run the Update-Help cmdlet to install the help files. Because a call to Update-Help downloads many help files, the command can fetch only once per day by default. You can override this fetching behavior by using the -Force flag.
You update the help files differently on Windows compared to Linux or macOS. The process differs because when you run the Update-Help cmdlet, help files are fetched over the internet by matching your computer’s culture. On Windows, a culture is already installed, but it’s missing on Linux and macOS. So you need to specify a culture when you update help files on Linux and macOS.
Update-Help -UICulture en-US -Verbose
This command specifies the -UICulture flag. It gives it the value en-US, which fetches US English help files. To update your help files on macOS or Linux, use a culture that corresponds to your machine’s culture.
NAME
Provides the name of the command.
SYNTAX
Shows ways to call the command by using a combination of flags, and sometimes, allowed parameters.
ALIASES
Lists any aliases for a command. An alias is a different name for a command, and it can be used to invoke the command.
REMARKS
Provides information about what commands to run to get more help for this command.
PARAMETERS
Provides details about the parameter. It lists its type, a longer description, and acceptable values, if applicable.
Filter the help response Full
Returns a detailed help page. It specifies information like parameters, inputs, and outputs that you don’t get in the standard response.
Filter the help response Detailed
Returns a response that looks like the standard response, but it includes a section for parameters.
Filter the help response Examples
Returns only examples, if any exist.
Filter the help response Online
Opens a web page for your command.
Filter the help response Parameter
Requires a parameter name as an argument. It lists a specific parameter’s properties.