commands

^

Find-DbaCommand

Author Simone Bizzotto (@niphlod)
Availability Windows, Linux, macOS

 

Want to see the source code for this command? Check out Find-DbaCommand on GitHub.
Want to see the Bill Of Health for this command? Check out Find-DbaCommand.

Synopsis

Finds dbatools commands searching through the inline help text

Description

Finds dbatools commands searching through the inline help text, building a consolidated json index and querying it because Get-Help is too slow

Syntax

Find-DbaCommand
    [[-Pattern] <String>]
    [[-Tag] <String[]>]
    [[-Author] <String>]
    [[-MinimumVersion] <String>]
    [[-MaximumVersion] <String>]
    [-Rebuild]
    [-EnableException]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Find-DbaCommand "snapshot"

For lazy typers: finds all commands searching the entire help for "snapshot"

Example: 2
PS C:\> Find-DbaCommand -Pattern "snapshot"

For rigorous typers: finds all commands searching the entire help for "snapshot"

Example: 3
PS C:\> Find-DbaCommand -Tag Job

Finds all commands tagged with "Job"

Example: 4
PS C:\> Find-DbaCommand -Tag Job,Owner

Finds all commands tagged with BOTH "Job" and "Owner"

Example: 5
PS C:\> Find-DbaCommand -Author Chrissy

Finds every command whose author contains our beloved "Chrissy"

Example: 6
PS C:\> Find-DbaCommand -Author Chrissy -Tag AG

Finds every command whose author contains our beloved "Chrissy" and it tagged as "AG"

Example: 7
PS C:\> Find-DbaCommand -Pattern snapshot -Rebuild

Finds all commands searching the entire help for "snapshot", rebuilding the index (good for developers)

Optional Parameters

-Pattern

Searches all help text properties (synopsis, description, examples, parameters) for the specified text pattern using wildcard matching.
Use this for broad searches when you know a concept or term but aren't sure which specific commands handle it.

Alias
Required False
Pipeline false
Default Value
-Tag

Filters results to show only commands that contain all specified tags. Tags categorize commands by SQL Server feature area like "Backup", "AG", "Job", or "Security".
Use this when you need to find commands related to specific SQL Server functionality. Multiple tags require commands to have ALL specified tags.

Alias
Required False
Pipeline false
Default Value
-Author

Filters results to show commands created by authors whose name contains the specified text. Uses wildcard matching so partial names work.
Useful when you want to find commands written by a specific contributor or when following up on recommendations from particular experts.

Alias
Required False
Pipeline false
Default Value
-MinimumVersion

Filters results to show only commands that require the specified minimum version of dbatools or higher.
Use this to ensure compatibility when working with older dbatools installations or when checking what features require recent updates.

Alias
Required False
Pipeline false
Default Value
-MaximumVersion

Filters results to show only commands that work with the specified maximum version of dbatools or lower.
Helpful when working with legacy environments where you need to avoid commands that require newer dbatools versions.

Alias
Required False
Pipeline false
Default Value
-Rebuild

Forces a complete rebuild of the dbatools command index from the current module state. This rescans all help text and updates the cached index file.
Use this when developing new commands, after updating dbatools, or when search results seem outdated or incomplete.

Alias
Required False
Pipeline false
Default Value False
-EnableException

By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.

Alias
Required False
Pipeline false
Default Value False
-WhatIf

Displays what would happen if the command is run

Alias wi
Required False
Pipeline false
Default Value
-Confirm

Confirms overwrite of index

Alias cf
Required False
Pipeline false
Default Value