Get-Command Flashcards
(32 cards)
What does this PowerShell cmdlet do?
Get-Command
Lists all available cmdlets, functions, workflows, aliases, and scripts.
## Footnote
It’s often used to discover what commands are available in the session.
Which cmdlet would you use to do the following?
List all available cmdlets, functions, workflows, aliases, and scripts.
Get-Command
What does this Get-Command
parameter do?
-Name
Specifies the name of the command to retrieve. Wildcards are supported.
## Footnote
Useful when you know part of a cmdlet’s name and want to filter results.
Which parameter would you use with Get-Command
to do the following?
Find commands by exact name or wildcard pattern.
-Name
What does this Get-Command
parameter do?
-Module
Limits the search to a specific module.
## Footnote
Helps inspect only the commands in one module.
Which parameter would you use with Get-Command
to do the following?
Search for commands inside a specific module.
-Module
What does this Get-Command
parameter do?
-CommandType
Filters results by command type: Cmdlet, Function, Alias, etc.
## Footnote
Use this to narrow search by kind of command you’re looking for.
Which parameter would you use with Get-Command
to do the following?
Filter results by type like Cmdlet, Function, or Alias.
-CommandType
What does this Get-Command
parameter do?
-Noun
Filters by the noun part of a cmdlet name.
## Footnote
Helpful when looking for related actions on the same object.
Which parameter would you use with Get-Command
to do the following?
List commands based on their noun like ‘Item’ or ‘Process’.
-Noun
What does this Get-Command
parameter do?
-Verb
Filters by the verb part of a cmdlet name.
## Footnote
Common verbs include Get, Set, Remove, etc.
Which parameter would you use with Get-Command
to do the following?
List commands that begin with a certain verb.
-Verb
What does this Get-Command
parameter do?
-ParameterName
Finds commands that support a given parameter.
## Footnote
Very helpful for cross-referencing parameter use.
Which parameter would you use with Get-Command
to do the following?
Find commands that support a specific parameter.
-ParameterName
What does this Get-Command
parameter do?
-Syntax
Displays only the syntax of matching commands.
## Footnote
Skips details and focuses on usage format.
Which parameter would you use with Get-Command
to do the following?
Display only the syntax of a command.
-Syntax
What does this Get-Command
parameter do?
-TotalCount
Limits the number of results returned.
## Footnote
Use this to get just a subset of matches.
Which parameter would you use with Get-Command
to do the following?
Limit the number of results shown.
-TotalCount
What does this Get-Command
parameter do?
-All
Includes all command definitions, including duplicates.
## Footnote
Useful when multiple commands have the same name across modules.
Which parameter would you use with Get-Command
to do the following?
Include all command definitions, even if duplicates exist.
-All
What does this Get-Command
parameter do?
-ListImported
Shows only commands from modules that have already been imported.
## Footnote
Prevents loading all modules when querying available commands.
Which parameter would you use with Get-Command
to do the following?
List only commands from already imported modules.
-ListImported
What datatype is required for the following parameter:
Get-Command -Name
string[]
What datatype is required for the following parameter:
Get-Command -Module
string[]