Skip to content

Commit 6264f79

Browse files
authored
Fix note about executable extensions (MicrosoftDocs#11529)
1 parent 03f8d66 commit 6264f79

File tree

3 files changed

+155
-131
lines changed

3 files changed

+155
-131
lines changed

reference/5.1/Microsoft.PowerShell.Core/Get-Command.md

Lines changed: 41 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
external help file: System.Management.Automation.dll-Help.xml
33
Locale: en-US
44
Module Name: Microsoft.PowerShell.Core
5-
ms.date: 01/21/2023
5+
ms.date: 11/09/2024
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/get-command?view=powershell-5.1&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
title: Get-Command
@@ -39,14 +39,15 @@ aliases, functions, filters, scripts, and applications. `Get-Command` gets the c
3939
PowerShell modules and commands that were imported from other sessions. To get only commands that
4040
have been imported into the current session, use the **ListImported** parameter.
4141

42-
Without parameters, `Get-Command` gets all of the cmdlets, functions, and aliases installed on the
43-
computer. `Get-Command *` gets all types of commands, including all of the non-PowerShell files in
44-
the Path environment variable (`$env:Path`), which it lists in the Application command type.
42+
Without parameters, `Get-Command` gets all the cmdlets, functions, and aliases installed on the
43+
computer. `Get-Command *` gets all types of commands, including all the non-PowerShell files in the
44+
Path environment variable (`$env:PATH`), which it lists in the Application command type.
4545

4646
`Get-Command` that uses the exact name of the command, without wildcard characters, automatically
4747
imports the module that contains the command so that you can use the command immediately. To enable,
4848
disable, and configure automatic importing of modules, use the `$PSModuleAutoLoadingPreference`
49-
preference variable. For more information, see [about_Preference_Variables](About/about_Preference_Variables.md).
49+
preference variable. For more information, see
50+
[about_Preference_Variables](About/about_Preference_Variables.md).
5051

5152
`Get-Command` gets its data directly from the command code, unlike `Get-Help`, which gets its
5253
information from help topics.
@@ -74,7 +75,7 @@ Get-Command -ListImported
7475

7576
### Example 3: Get cmdlets and display them in order
7677

77-
This command gets all of the cmdlets, sorts them alphabetically by the noun in the cmdlet name, and
78+
This command gets all the cmdlets, sorts them alphabetically by the noun in the cmdlet name, and
7879
then displays them in noun-based groups. This display can help you find the cmdlets for a task.
7980

8081
```powershell
@@ -93,7 +94,7 @@ Get-Command -Module Microsoft.PowerShell.Security, Microsoft.PowerShell.Utility
9394
### Example 5: Get information about a cmdlet
9495

9596
This command gets information about the `Get-AppLockerPolicy` cmdlet. It also imports the
96-
**AppLocker** module, which adds all of the commands in the **AppLocker** module to the current
97+
**AppLocker** module, which adds all the commands in the **AppLocker** module to the current
9798
session.
9899

99100
```powershell
@@ -103,28 +104,30 @@ Get-Command Get-AppLockerPolicy
103104
When a module is imported automatically, the effect is the same as using the Import-Module cmdlet.
104105
The module can add commands, types and formatting files, and run scripts in the session. To enable,
105106
disable, and configuration automatic importing of modules, use the `$PSModuleAutoLoadingPreference`
106-
preference variable. For more information, see [about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md).
107+
preference variable. For more information, see
108+
[about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md).
107109

108110
### Example 6: Get the syntax of a cmdlet
109111

110112
This command uses the **ArgumentList** and **Syntax** parameters to get the syntax of the
111-
`Get-ChildItem` cmdlet when it is used in the Cert: drive. The Cert: drive is a PowerShell drive
112-
that the Certificate Provider adds to the session.
113+
`Get-ChildItem` cmdlet when it's used in the Cert: drive. The Cert: drive is a PowerShell drive that
114+
the Certificate Provider adds to the session.
113115

114116
```powershell
115117
Get-Command -Name Get-Childitem -Args Cert: -Syntax
116118
```
117119

118-
When you compare the syntax displayed in the output with the syntax that is displayed when you omit
119-
the **Args** (**ArgumentList**) parameter, you'll see that the **Certificate provider** adds a dynamic
120-
parameter, **CodeSigningCert**, to the `Get-ChildItem` cmdlet.
120+
When you compare the syntax displayed in the output with the syntax that's displayed when you omit
121+
the **Args** (**ArgumentList**) parameter, you'll see that the **Certificate provider** adds a
122+
dynamic parameter, **CodeSigningCert**, to the `Get-ChildItem` cmdlet.
121123

122-
For more information about the Certificate provider, see [about_Certificate_Provider](../Microsoft.PowerShell.Security/About/about_Certificate_Provider.md).
124+
For more information about the Certificate provider, see
125+
[about_Certificate_Provider](../Microsoft.PowerShell.Security/About/about_Certificate_Provider.md).
123126

124127
### Example 7: Get dynamic parameters
125128

126129
The command in the example uses the `Get-DynamicParameters` function to get the dynamic parameters
127-
that the Certificate provider adds to the `Get-ChildItem` cmdlet when it is used in the Cert: drive.
130+
that the Certificate provider adds to the `Get-ChildItem` cmdlet when it's used in the Cert: drive.
128131

129132
```powershell
130133
function Get-DynamicParameters
@@ -151,7 +154,7 @@ cmdlet by another cmdlet or a provider.
151154
### Example 8: Get all commands of all types
152155

153156
This command gets all commands of all types on the local computer, including executable files in the
154-
paths of the **Path** environment variable (`$env:path`).
157+
paths of the **Path** environment variable (`$env:PATH`).
155158

156159
```powershell
157160
Get-Command *
@@ -169,7 +172,7 @@ This command gets cmdlets that have a parameter whose name includes Auth and who
169172
Get-Command -ParameterName *Auth* -ParameterType AuthenticationMechanism
170173
```
171174

172-
You can use a command like this one to find cmdlets that let you specify the method that is used to
175+
You can use a command like this one to find cmdlets that let you specify the method that's used to
173176
authenticate the user.
174177

175178
The **ParameterType** parameter distinguishes parameters that take an **AuthenticationMechanism**
@@ -189,7 +192,7 @@ CommandType Name ModuleName
189192
Alias dir -> Get-ChildItem
190193
```
191194

192-
Although it is typically used on cmdlets and functions, `Get-Command` also gets scripts, functions,
195+
Although it's typically used on cmdlets and functions, `Get-Command` also gets scripts, functions,
193196
aliases, and executable files.
194197

195198
The output of the command shows the special view of the **Name** property value for aliases. The
@@ -220,7 +223,8 @@ the **All** parameter, `Get-Command` gets all commands with the specified name a
220223
execution precedence order. To run a command other than the first one in the list, type the fully
221224
qualified path to the command.
222225

223-
For more information about command precedence, see [about_Command_Precedence](About/about_Command_Precedence.md).
226+
For more information about command precedence, see
227+
[about_Command_Precedence](About/about_Command_Precedence.md).
224228

225229
### Example 12: Get the name of a module that contains a cmdlet
226230

@@ -235,7 +239,7 @@ The command uses the **ModuleName** property of all commands.
235239
Microsoft.PowerShell.Utility
236240
```
237241

238-
This command format works on commands in PowerShell modules, even if they are not imported into the
242+
This command format works on commands in PowerShell modules, even if they're not imported into the
239243
session.
240244

241245
### Example 13: Get cmdlets and functions that have an output type
@@ -288,10 +292,10 @@ get the first net adapter that the cmdlet returns.
288292
Indicates that this cmdlet gets all commands, including commands of the same type that have the same
289293
name. By default, `Get-Command` gets only the commands that run when you type the command name.
290294

291-
For more information about the method that PowerShell uses to select the command to run when
292-
multiple commands have the same name, see [about_Command_Precedence](About/about_Command_Precedence.md).
293-
For information about module-qualified command names and running commands that do not run by default
294-
because of a name conflict, see [about_Modules](About/about_Modules.md).
295+
For more information about the order that PowerShell searches for commands, see
296+
[about_Command_Precedence](About/about_Command_Precedence.md). For information about
297+
module-qualified command names and running commands that don't run by default because of a name
298+
conflict, see [about_Modules](About/about_Modules.md).
295299

296300
This parameter was introduced in Windows PowerShell 3.0.
297301

@@ -311,15 +315,15 @@ Accept wildcard characters: False
311315
312316
### -ArgumentList
313317
314-
Specifies an array of arguments. This cmdlet gets information about a cmdlet or function when it is
318+
Specifies an array of arguments. This cmdlet gets information about a cmdlet or function when it's
315319
used with the specified parameters ("arguments"). The alias for **ArgumentList** is **Args**.
316320
317321
To detect dynamic parameters that are available only when certain other parameters are used, set the
318322
value of **ArgumentList** to the parameters that trigger the dynamic parameters.
319323
320324
To detect the dynamic parameters that a provider adds to a cmdlet, set the value of the
321-
**ArgumentList** parameter to a path in the provider drive, such as WSMan:, HKLM:, or Cert:. When
322-
the command is a PowerShell provider cmdlet, enter only one path in each command. The provider
325+
**ArgumentList** parameter to a path in the provider drive, such as `WSMan:`, `HKLM:`, or `Cert:`.
326+
When the command is a PowerShell provider cmdlet, enter only one path in each command. The provider
323327
cmdlets return only the dynamic parameters for the first path the value of **ArgumentList**. For
324328
information about the provider cmdlets, see [about_Providers](About/about_Providers.md).
325329

@@ -348,18 +352,19 @@ The acceptable values for this parameter are:
348352

349353
- `All`: Gets all command types. This parameter value is the equivalent of `Get-Command *`.
350354

351-
- `Application`: Gets non-PowerShell files in paths listed in the **Path** environment variable
352-
(`$env:path`), including `.txt`, `.exe`, and `.dll` files. For more information about the **Path**
353-
environment variable, see [about_Environment_Variables](About/about_Environment_Variables.md).
355+
- `Application`: Searches folders in the `$env:PATH` environment variable for non-PowerShell
356+
executable files. On Windows, executable files have a file extension that is listed in the
357+
`$env:PATHEXT` environment variable. For more information, see
358+
[about_Environment_Variables](About/about_Environment_Variables.md).
354359

355360
- `Cmdlet`: Gets all cmdlets.
356361

357362
- `ExternalScript`: Gets all `.ps1` files in the paths listed in the **Path** environment variable
358-
(`$env:path`).
363+
(`$env:PATH`).
359364

360365
- `Filter` and `Function`: Gets all PowerShell advanced and simple functions and filters.
361366

362-
- `Script`: Gets all script blocks. To get PowerShell scripts (`.ps1 `files), use the
367+
- `Script`: Gets all script blocks. To get PowerShell scripts (`.ps1` files), use the
363368
`ExternalScript` value.
364369

365370
- `Workflow`: Gets all workflows. For more information about workflows, see Introducing Windows
@@ -409,7 +414,7 @@ A module specification is a hashtable that has the following keys.
409414
- `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with
410415
the other Version keys.
411416

412-
You cannot specify the **FullyQualifiedModule** parameter in the same command as a **Module**
417+
You can't specify the **FullyQualifiedModule** parameter in the same command as a **Module**
413418
parameter. The two parameters are mutually exclusive.
414419

415420
```yaml
@@ -629,7 +634,8 @@ Accept wildcard characters: True
629634

630635
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
631636
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
632-
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](About/about_CommonParameters.md).
637+
-WarningAction, and -WarningVariable. For more information, see
638+
[about_CommonParameters](About/about_CommonParameters.md).
633639

634640
## INPUTS
635641

@@ -641,7 +647,7 @@ You can pipe command names to this cmdlet.
641647

642648
### System.Management.Automation.CommandInfo
643649

644-
This cmdlet returns objects derived from the **CommandInfo** class. The type of object that is
650+
This cmdlet returns objects derived from the **CommandInfo** class. The type of object that's
645651
returned depends on the type of command that `Get-Command` gets.
646652

647653
### System.Management.Automation.AliasInfo

0 commit comments

Comments
 (0)