Skip to content

Get-Help should have an option to force full-text search #26430

@brasswood

Description

@brasswood

Summary of the new feature / enhancement

I was trying to use the built-in help system to learn how to search for text in output, like grep on Unix. So, I tried this command:

Get-Help *find*

Name                              Category  Module                    Synopsis
----                              --------  ------                    --------
Find-PSResource                   Cmdlet    Microsoft.PowerShell.PSR… Find-PSResourceFind-PackageProvider              Cmdlet    PackageManagement         Find-PackageProviderFind-Package                      Cmdlet    PackageManagement         Find-PackageFind-Script                       Function  PowerShellGet             …
Find-Command                      Function  PowerShellGet             …
Find-RoleCapability               Function  PowerShellGet             …
Find-Module                       Function  PowerShellGet             …
Find-DSCResource                  Function  PowerShellGet             …
Find-LapsADExtendedRights         Cmdlet    LAPS                      Find-LapsADExtendedRightsFind-NetIPsecRule                 Function  NetSecurity               …
Find-NetRoute                     Function  NetTCPIP                  …

As you can see, this brought up several commands that had "find" in their name, but none of them were what I needed. I asked ChatGPT and it said "Select-String." I looked at the help page for Select-String:

Get-Help Select-String

NAME
    Select-String

SYNOPSIS
    Finds text in strings and files.
...

Hmm...

Get-Help "finds text"

Name                              Category  Module                    Synopsis
----                              --------  ------                    --------
Select-String                     Cmdlet    Microsoft.PowerShell.Uti… Finds text in strings and files.
Select-Xml                        Cmdlet    Microsoft.PowerShell.Uti… Finds text in an XML string or document.

There it is!

When you are using the help system to try to find a command, you don't know what that command is called. In my case, I thought it might contain "find" in the name or description. Had Get-Help done a full-text search, I would have found the command I needed with this query. Instead, the command was hidden from me because a bunch of commands I didn't need had "find" in the name. As someone new to PowerShell, I could not easily guess what a good query string would be to avoid this situation, because I know nothing about the commands! That's why I'm using Get-Help in the first place!

The moral of this story is that there should be a way to force Get-Help to do a full-text search regardless of whether the pattern matches any command names. However, from reading the help page for Get-Help, it looks like the only way to get it to do a full-text search is to give it a search term that doesn't match the name of any command.

Proposed technical implementation details (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugPowerShell-Docs neededThe PR was reviewed and a PowerShell Docs update is neededResolution-DeclinedThe proposed feature is declined.WG-Interactive-HelpSystemhelp infrastructure and formatting of helpWG-ReviewedA Working Group has reviewed this and made a recommendation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions