22external help file : System.Management.Automation.dll-Help.xml
33Locale : en-US
44Module Name : Microsoft.PowerShell.Core
5- ms.date : 11/09/2024
5+ ms.date : 01/17/2025
66online version : https://learn.microsoft.com/powershell/module/microsoft.powershell.core/get-command?view=powershell-7.6&WT.mc_id=ps-gethelp
77schema : 2.0.0
88title : Get-Command
@@ -17,20 +17,20 @@ Gets all commands.
1717### CmdletSet (Default)
1818
1919```
20- Get-Command [-Verb <String []>] [-Noun <String []>] [-Module <String []>]
21- [-FullyQualifiedModule <ModuleSpecification []>] [-TotalCount <Int32 >] [-Syntax] [-ShowCommandInfo ]
22- [[-ArgumentList] <Object[] >] [-All ] [-ListImported ] [-ParameterName <String[]> ]
23- [-ParameterType <PSTypeName[]>] [<CommonParameters>]
20+ Get-Command [[-ArgumentList] <Object []>] [-Verb <string []>] [-Noun <string []>]
21+ [-Module <string []>] [-ExcludeModule <string[] >] [-FullyQualifiedModule <ModuleSpecification[]> ]
22+ [-TotalCount <int >] [-Syntax ] [-ShowCommandInfo ] [-All] [-ListImported ]
23+ [-ParameterName <string[]>] [- ParameterType <PSTypeName[]>] [<CommonParameters>]
2424```
2525
2626### AllCommandSet
2727
2828```
29- Get-Command [[-Name] <String []>] [- Module <String []>]
30- [-FullyQualifiedModule <ModuleSpecification []>] [-CommandType <CommandTypes>] [-TotalCount <Int32 >]
31- [-Syntax] [-ShowCommandInfo ] [[-ArgumentList] <Object[] >] [-All ] [-ListImported ]
32- [-ParameterName <String []>] [-ParameterType <PSTypeName[]>] [-UseFuzzyMatching]
33- [-FuzzyMinimumDistance <UInt32 >] [-UseAbbreviationExpansion] [<CommonParameters>]
29+ Get-Command [[-Name] <string []>] [[-ArgumentList] <Object[]>] [- Module <string []>]
30+ [-ExcludeModule <string []>] [-FullyQualifiedModule <ModuleSpecification[] >]
31+ [-CommandType <CommandTypes> ] [-TotalCount <int >] [-Syntax ] [-ShowCommandInfo] [-All ]
32+ [-ListImported] [- ParameterName <string []>] [-ParameterType <PSTypeName[]>] [-UseFuzzyMatching]
33+ [-FuzzyMinimumDistance <uint >] [-UseAbbreviationExpansion] [<CommonParameters>]
3434```
3535
3636## DESCRIPTION
@@ -324,6 +324,18 @@ Application getconf 0.0.0.0 /usr/bin/getconf
324324Application command 0.0.0.0 /usr/bin/command
325325```
326326
327+ ### Example 17: Exclude modules from the search for commands
328+
329+ The following example shows the difference in results of searching for commands in all modules and
330+ when you exclude a specific module.
331+
332+ ``` powershell
333+ PS> (Get-Command *-*Disk*).Count
334+ 73
335+ PS> (Get-Command *-*Disk* -ExcludeModule Storage).Count
336+ 35
337+ ```
338+
327339## PARAMETERS
328340
329341### -All
@@ -425,6 +437,22 @@ Accept pipeline input: True (ByPropertyName)
425437Accept wildcard characters: False
426438` ` `
427439
440+ # ## ExcludeModule
441+
442+ Specify the name of one or more modules to be excluded from the search.
443+
444+ ` ` ` yaml
445+ Type: System.String[]
446+ Parameter Sets: (All)
447+ Aliases:
448+
449+ Required: False
450+ Position: Named
451+ Default value: None
452+ Accept pipeline input: ByValue (False), ByName (False)
453+ Accept wildcard characters: False
454+ ` ` `
455+
428456# ## -FullyQualifiedModule
429457
430458The value can be a module name, a full module specification, or a path to a module file.
0 commit comments