Get-Command Flashcards

(32 cards)

1
Q

What does this PowerShell cmdlet do?

Get-Command

A

Lists all available cmdlets, functions, workflows, aliases, and scripts.
## Footnote
It’s often used to discover what commands are available in the session.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which cmdlet would you use to do the following?

List all available cmdlets, functions, workflows, aliases, and scripts.

A

Get-Command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does this Get-Command parameter do?

-Name

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which parameter would you use with Get-Command to do the following?

Find commands by exact name or wildcard pattern.

A

-Name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does this Get-Command parameter do?

-Module

A

Limits the search to a specific module.
## Footnote
Helps inspect only the commands in one module.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which parameter would you use with Get-Command to do the following?

Search for commands inside a specific module.

A

-Module

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does this Get-Command parameter do?

-CommandType

A

Filters results by command type: Cmdlet, Function, Alias, etc.
## Footnote
Use this to narrow search by kind of command you’re looking for.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which parameter would you use with Get-Command to do the following?

Filter results by type like Cmdlet, Function, or Alias.

A

-CommandType

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does this Get-Command parameter do?

-Noun

A

Filters by the noun part of a cmdlet name.
## Footnote
Helpful when looking for related actions on the same object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which parameter would you use with Get-Command to do the following?

List commands based on their noun like ‘Item’ or ‘Process’.

A

-Noun

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does this Get-Command parameter do?

-Verb

A

Filters by the verb part of a cmdlet name.
## Footnote
Common verbs include Get, Set, Remove, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which parameter would you use with Get-Command to do the following?

List commands that begin with a certain verb.

A

-Verb

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does this Get-Command parameter do?

-ParameterName

A

Finds commands that support a given parameter.
## Footnote
Very helpful for cross-referencing parameter use.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which parameter would you use with Get-Command to do the following?

Find commands that support a specific parameter.

A

-ParameterName

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does this Get-Command parameter do?

-Syntax

A

Displays only the syntax of matching commands.
## Footnote
Skips details and focuses on usage format.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which parameter would you use with Get-Command to do the following?

Display only the syntax of a command.

17
Q

What does this Get-Command parameter do?

-TotalCount

A

Limits the number of results returned.
## Footnote
Use this to get just a subset of matches.

18
Q

Which parameter would you use with Get-Command to do the following?

Limit the number of results shown.

19
Q

What does this Get-Command parameter do?

-All

A

Includes all command definitions, including duplicates.
## Footnote
Useful when multiple commands have the same name across modules.

20
Q

Which parameter would you use with Get-Command to do the following?

Include all command definitions, even if duplicates exist.

21
Q

What does this Get-Command parameter do?

-ListImported

A

Shows only commands from modules that have already been imported.
## Footnote
Prevents loading all modules when querying available commands.

22
Q

Which parameter would you use with Get-Command to do the following?

List only commands from already imported modules.

A

-ListImported

23
Q

What datatype is required for the following parameter:

Get-Command -Name

24
Q

What datatype is required for the following parameter:

Get-Command -Module

25
# What datatype is required for the following parameter: Get-Command -CommandType
CommandTypes[]
26
# What datatype is required for the following parameter: Get-Command -Noun
string[]
27
# What datatype is required for the following parameter: Get-Command -Verb
string[]
28
# What datatype is required for the following parameter: Get-Command -ParameterName
string
29
# What datatype is required for the following parameter: Get-Command -Syntax
None: parameter is a switch
30
# What datatype is required for the following parameter: Get-Command -TotalCount
int
31
# What datatype is required for the following parameter: Get-Command -All
None: parameter is a switch
32
# What datatype is required for the following parameter: Get-Command -ListImported
None: parameter is a switch