Skip to content

Commit 421ae20

Browse files
authored
Add notes to Get-Command results (#12298)
1 parent b5df2e3 commit 421ae20

File tree

4 files changed

+78
-48
lines changed

4 files changed

+78
-48
lines changed

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

Lines changed: 19 additions & 12 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: 11/09/2024
5+
ms.date: 08/19/2025
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
aliases:
@@ -38,8 +38,8 @@ Get-Command [[-Name] <String[]>] [-Module <String[]>]
3838

3939
The `Get-Command` cmdlet gets all commands that are installed on the computer, including cmdlets,
4040
aliases, functions, filters, scripts, and applications. `Get-Command` gets the commands from
41-
PowerShell modules and commands that were imported from other sessions. To get only commands that
42-
have been imported into the current session, use the **ListImported** parameter.
41+
PowerShell modules and commands available on your system. To get only commands that have been
42+
imported into the current session, use the **ListImported** parameter.
4343

4444
Without parameters, `Get-Command` gets all the cmdlets, functions, and aliases installed on the
4545
computer. `Get-Command *` gets all types of commands, including all the non-PowerShell files in the
@@ -678,15 +678,22 @@ Windows PowerShell includes the following aliases for `Get-Command`:
678678

679679
- `gcm`
680680

681-
- When more than one command that has the same name is available to the session, `Get-Command`
682-
returns the command that runs when you type the command name. To get commands that have the same
683-
name, listed in run order, use the **All** parameter. For more information, see
684-
[about_Command_Precedence](../Microsoft.PowerShell.Core/About/about_Command_Precedence.md).
685-
- When a module is imported automatically, the effect is the same as using the `Import-Module`
686-
cmdlet. The module can add commands, types and formatting files, and run scripts in the session.
687-
To enable, disable, and configuration automatic importing of modules, use the
688-
`$PSModuleAutoLoadingPreference` preference variable. For more information, see
689-
[about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md).
681+
When more than one command that has the same name is available to the session, `Get-Command` returns
682+
the command that runs when you type the command name. To get commands that have the same name,
683+
listed in run order, use the **All** parameter. For more information, see
684+
[about_Command_Precedence](About/about_Command_Precedence.md).
685+
686+
If you run `Get-Command` with the exact name of the command, without wildcard characters, PowerShell
687+
searches for the command in all available modules. If the module containing the command isn't loaded
688+
yet, the result returned by `Get-Command` only contains information that can be discovered from the
689+
module manifest. For example, the **ScriptBlock** property might not be populated in the initial
690+
result. However, PowerShell automatically imports the module after it returns the initial result.
691+
692+
When a module is imported automatically, the effect is the same as using the `Import-Module` cmdlet.
693+
The module can add commands, types and formatting files, and run scripts in the session. To enable,
694+
disable, and configuration automatic importing of modules, use the `$PSModuleAutoLoadingPreference`
695+
preference variable. For more information, see
696+
[about_Preference_Variables](About/about_Preference_Variables.md).
690697

691698
## RELATED LINKS
692699

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

Lines changed: 19 additions & 12 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: 11/09/2024
5+
ms.date: 08/19/2025
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/get-command?view=powershell-7.4&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
aliases:
@@ -39,8 +39,8 @@ Get-Command [[-Name] <String[]>] [-Module <String[]>]
3939

4040
The `Get-Command` cmdlet gets all commands that are installed on the computer, including cmdlets,
4141
aliases, functions, filters, scripts, and applications. `Get-Command` gets the commands from
42-
PowerShell modules and commands that were imported from other sessions. To get only commands that
43-
have been imported into the current session, use the **ListImported** parameter.
42+
PowerShell modules and commands available on your system. To get only commands that have been
43+
imported into the current session, use the **ListImported** parameter.
4444

4545
Without parameters, `Get-Command` gets all the cmdlets, functions, and aliases installed on the
4646
computer. `Get-Command *` gets all types of commands, including all the non-PowerShell files in the
@@ -763,15 +763,22 @@ PowerShell includes the following aliases for `Get-Command`:
763763
- All platforms:
764764
- `gcm`
765765

766-
- When more than one command that has the same name is available to the session, `Get-Command`
767-
returns the command that runs when you type the command name. To get commands that have the same
768-
name, listed in run order, use the **All** parameter. For more information, see
769-
[about_Command_Precedence](../Microsoft.PowerShell.Core/About/about_Command_Precedence.md).
770-
- When a module is imported automatically, the effect is the same as using the `Import-Module`
771-
cmdlet. The module can add commands, types and formatting files, and run scripts in the session.
772-
To enable, disable, and configuration automatic importing of modules, use the
773-
`$PSModuleAutoLoadingPreference` preference variable. For more information, see
774-
[about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md).
766+
When more than one command that has the same name is available to the session, `Get-Command` returns
767+
the command that runs when you type the command name. To get commands that have the same name,
768+
listed in run order, use the **All** parameter. For more information, see
769+
[about_Command_Precedence](About/about_Command_Precedence.md).
770+
771+
If you run `Get-Command` with the exact name of the command, without wildcard characters, PowerShell
772+
searches for the command in all available modules. If the module containing the command isn't loaded
773+
yet, the result returned by `Get-Command` only contains information that can be discovered from the
774+
module manifest. For example, the **ScriptBlock** property might not be populated in the initial
775+
result. However, PowerShell automatically imports the module after it returns the initial result.
776+
777+
When a module is imported automatically, the effect is the same as using the `Import-Module` cmdlet.
778+
The module can add commands, types and formatting files, and run scripts in the session. To enable,
779+
disable, and configuration automatic importing of modules, use the `$PSModuleAutoLoadingPreference`
780+
preference variable. For more information, see
781+
[about_Preference_Variables](About/about_Preference_Variables.md).
775782

776783
## RELATED LINKS
777784

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

Lines changed: 19 additions & 12 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: 11/09/2024
5+
ms.date: 08/19/2025
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/get-command?view=powershell-7.5&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
aliases:
@@ -39,8 +39,8 @@ Get-Command [[-Name] <String[]>] [-Module <String[]>]
3939

4040
The `Get-Command` cmdlet gets all commands that are installed on the computer, including cmdlets,
4141
aliases, functions, filters, scripts, and applications. `Get-Command` gets the commands from
42-
PowerShell modules and commands that were imported from other sessions. To get only commands that
43-
have been imported into the current session, use the **ListImported** parameter.
42+
PowerShell modules and commands available on your system. To get only commands that have been
43+
imported into the current session, use the **ListImported** parameter.
4444

4545
Without parameters, `Get-Command` gets all the cmdlets, functions, and aliases installed on the
4646
computer. `Get-Command *` gets all types of commands, including all the non-PowerShell files in the
@@ -763,15 +763,22 @@ PowerShell includes the following aliases for `Get-Command`:
763763
- All platforms:
764764
- `gcm`
765765

766-
- When more than one command that has the same name is available to the session, `Get-Command`
767-
returns the command that runs when you type the command name. To get commands that have the same
768-
name, listed in run order, use the **All** parameter. For more information, see
769-
[about_Command_Precedence](About/about_Command_Precedence.md).
770-
- When a module is imported automatically, the effect is the same as using the `Import-Module`
771-
cmdlet. The module can add commands, types and formatting files, and run scripts in the session.
772-
To enable, disable, and configuration automatic importing of modules, use the
773-
`$PSModuleAutoLoadingPreference` preference variable. For more information, see
774-
[about_Preference_Variables](About/about_Preference_Variables.md).
766+
When more than one command that has the same name is available to the session, `Get-Command` returns
767+
the command that runs when you type the command name. To get commands that have the same name,
768+
listed in run order, use the **All** parameter. For more information, see
769+
[about_Command_Precedence](About/about_Command_Precedence.md).
770+
771+
If you run `Get-Command` with the exact name of the command, without wildcard characters, PowerShell
772+
searches for the command in all available modules. If the module containing the command isn't loaded
773+
yet, the result returned by `Get-Command` only contains information that can be discovered from the
774+
module manifest. For example, the **ScriptBlock** property might not be populated in the initial
775+
result. However, PowerShell automatically imports the module after it returns the initial result.
776+
777+
When a module is imported automatically, the effect is the same as using the `Import-Module` cmdlet.
778+
The module can add commands, types and formatting files, and run scripts in the session. To enable,
779+
disable, and configuration automatic importing of modules, use the `$PSModuleAutoLoadingPreference`
780+
preference variable. For more information, see
781+
[about_Preference_Variables](About/about_Preference_Variables.md).
775782

776783
## RELATED LINKS
777784

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

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
external help file: System.Management.Automation.dll-Help.xml
33
Locale: en-US
44
Module Name: Microsoft.PowerShell.Core
5-
ms.date: 11/09/2024
5+
ms.date: 08/19/2025
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
8+
aliases:
9+
- gcm
810
title: Get-Command
911
---
1012
# Get-Command
@@ -37,8 +39,8 @@ Get-Command [[-Name] <string[]>] [[-ArgumentList] <Object[]>] [-Module <string[]
3739

3840
The `Get-Command` cmdlet gets all commands that are installed on the computer, including cmdlets,
3941
aliases, functions, filters, scripts, and applications. `Get-Command` gets the commands from
40-
PowerShell modules and commands that were imported from other sessions. To get only commands that
41-
have been imported into the current session, use the **ListImported** parameter.
42+
PowerShell modules and commands available on your system. To get only commands that have been
43+
imported into the current session, use the **ListImported** parameter.
4244

4345
Without parameters, `Get-Command` gets all the cmdlets, functions, and aliases installed on the
4446
computer. `Get-Command *` gets all types of commands, including all the non-PowerShell files in the
@@ -789,15 +791,22 @@ PowerShell includes the following aliases for `Get-Command`:
789791
- All platforms:
790792
- `gcm`
791793

792-
- When more than one command that has the same name is available to the session, `Get-Command`
793-
returns the command that runs when you type the command name. To get commands that have the same
794-
name, listed in run order, use the **All** parameter. For more information, see
795-
[about_Command_Precedence](../Microsoft.PowerShell.Core/About/about_Command_Precedence.md).
796-
- When a module is imported automatically, the effect is the same as using the `Import-Module`
797-
cmdlet. The module can add commands, types and formatting files, and run scripts in the session.
798-
To enable, disable, and configuration automatic importing of modules, use the
799-
`$PSModuleAutoLoadingPreference` preference variable. For more information, see
800-
[about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md).
794+
When more than one command that has the same name is available to the session, `Get-Command` returns
795+
the command that runs when you type the command name. To get commands that have the same name,
796+
listed in run order, use the **All** parameter. For more information, see
797+
[about_Command_Precedence](About/about_Command_Precedence.md).
798+
799+
If you run `Get-Command` with the exact name of the command, without wildcard characters, PowerShell
800+
searches for the command in all available modules. If the module containing the command isn't loaded
801+
yet, the result returned by `Get-Command` only contains information that can be discovered from the
802+
module manifest. For example, the **ScriptBlock** property might not be populated in the initial
803+
result. However, PowerShell automatically imports the module after it returns the initial result.
804+
805+
When a module is imported automatically, the effect is the same as using the `Import-Module` cmdlet.
806+
The module can add commands, types and formatting files, and run scripts in the session. To enable,
807+
disable, and configuration automatic importing of modules, use the `$PSModuleAutoLoadingPreference`
808+
preference variable. For more information, see
809+
[about_Preference_Variables](About/about_Preference_Variables.md).
801810

802811
## RELATED LINKS
803812

0 commit comments

Comments
 (0)