Find-CommandFind-Command

Localiza comandos do PowerShell em módulos.Finds PowerShell commands in modules.

DescriçãoDescription

O cmdlet Find-Command localiza comandos do PowerShell, como cmdlets, aliases, funções e fluxos de trabalho.The Find-Command cmdlet finds PowerShell commands such as cmdlets, aliases, functions, and workflows. Find-Command faz pesquisas em módulos em repositórios registrados.Find-Command searches modules in registered repositories. Para cada comando que localiza, esse cmdlet retorna um objeto PSGetCommandInfo.For each command that this cmdlet finds, it returns a PSGetCommandInfo object. Você pode passar um objeto PSGetCommandInfo para o cmdlet Install-Module para instalar o módulo que contém o comando.You can pass a PSGetCommandInfo object to the Install-Module cmdlet to install the module that contains the command.

  • Find-Command pode filtrar segundo os parâmetros de versão: MinimumVersion, RequiredVersion, AllVersions.Find-Command can filter with version parameters: MinimumVersion, RequiredVersion, AllVersions.
    • Esses parâmetros são mutuamente exclusivos.These parameters are mutually exclusive.
    • Esses parâmetros de versão são permitidos apenas com o nome exclusivo do módulo, sem curingas.These version parameters are allowed only with the single module name without any wildcards.
    • Se o parâmetro RequiredVersion não for especificado, Find-Command retorna a versão mais recente do módulo que for igual ou maior que a versão mínima especificada ou a versão mais recente do módulo se nenhuma versão mínima tiver sido especificada.If the RequiredVersion parameter is not specified, Find-Command returns the latest version of the module that is equal to or greater than the minimum version specified or the latest version of the module if no minimum version is specified.
    • Se o parâmetro RequiredVersion for especificado, Find-Command retornará apenas a versão do módulo que corresponde exatamente à versão especificada.If the RequiredVersion parameter is specified, Find-Command only returns the version of the module that exactly matches the specified version.
  • Find-Command pode filtrar os metadados do módulo com o parâmetro -TagFind-Command can filter on module metadata with the -Tag parameter
  • Find-Command pode filtrar a linguagem de pesquisa específica do repositório com o parâmetro -Filter.Find-Command can filter on repository-specific search language with the -Filter parameter.
  • Find-Command pode filtrar módulos de todos ou de alguns dos repositórios registrados.Find-Command can filter on modules from all or few of the registered repositories.

Sintaxe do cmdletCmdlet syntax

Get-Command -Name Find-Command -Module PowerShellGet -Syntax

Referência da ajuda online sobre cmdletsCmdlet online help reference

Find-CommandFind-Command

Comandos de exemploExample commands


# Find a specific command
Find-Command -Name Get-ScriptAnalyzerRule

Name                                Version    ModuleName                          Repository
----                                -------    ----------                          ----------
Get-ScriptAnalyzerRule              1.5.0      PSScriptAnalyzer                    PSGallery

# Find multiple commands
Find-Command -Name Get-ScriptAnalyzerRule, Invoke-ScriptAnalyzer

# Find all available commands from all registered repositories
Find-Command

# Find available commands from few registered repositories
Find-Command -Repository PSGallery,PrivatePSGallery

# Find all commands in a specified repository
Find-Command -Repository PSGallery

# Find a command defined in a specific module
Find-Command -Name Get-ScriptAnalyzerRule -Module PSScriptAnalyzer

# Find commands from all versions of a module
Find-Command -ModuleName PSReadline -AllVersions

# Find commands with module name and MinimumVersion.
Find-Command -ModuleName PSReadline -MinimumVersion 1.1

# Find commands with module name and exact version
Find-Command -ModuleName AzureRM -RequiredVersion 1.4.0

# Find commands defined modules with -Filter based search. -Filter searches in description and module names
Find-Command -Filter Cookbook
Find-Command -Filter RBAC

# Find all commands with tags Azure or DSC in module metadata
Find-Command -Tag Azure, DSC