Skip to content

Extend Get-Help to support online documentation lookup for built-in .NET types #11338

Closed

Description

See also:

Summary of the new feature/enhancement

Get-Help supporting online lookup of documentation for built-in .NET types (those that ship with the framework / PowerShell) would be ... uh ... helpful, given:

Both looking up by type name alone as well as a combination of type name and member name (to get help for a specific method, for instance) would be beneficial.

Proposed technical implementation details (optional)

Note that since .NET documentation is only available online, conceptually -Online is implied when targeting .NET types.

Here's how it could work:

# WISHFUL THINKING

# Opens the documentation for the System.String.Split() method.
# Note:
#  You can specify a type name ('string' in this example) as follows:
#    * Use a full type name, with the initial 'System.' component optionally omitted (e.g. 'Text.Encoding' for 'System.Text.Encoding'
#    * Use a PowerShell type accelerator such as 'xml' for 'System.Xml.XmlDocument'
# Tab-completion can assist: You can type (part of) a the name of a type
# (last component of the full name) and cycle through loaded types by that name.
# E.g., typing `arrayli` tab-completes to 'System.Collections.ArrayList', which is the 
# Alternatively, *pipe* an instance of a string to the function (see next example).
Get-Help -Type string -Member split

# Opens the documentation for the [Microsoft.PowerShell.Commands.MatchInfo]
# type, instances of which Select-String outputs.
'foo' | Select-String o | Get-Help 

Note:

  • Technically, Get-Help currently binds the -Name parameter by property value from the pipeline, but that appears to be broken anyway (and I've never seen it in the wild). Therefore binding pipeline objects to a new -InputObject parameter whose (distinct set of ) types are to be looked up should work.

    • Being able to do something like 'foo'.Split | Get-Help would be great, but, unfortunately, the resulting PSMethodInfo instances contain no information about the enclosing type.
  • The lookup URL should include a ?view=netcore-<major>.<minor> / ?view=netframework-<major>.<minor> query string reflecting the .NET platform underlying the executing PowerShell engine.

  • For an implementation of this functionality as PowerShell function Show-TypeHelp (focused on .NET type lookup only), see this Stack Overflow answer.

Activity

  1. added
    Issue-Enhancement
    on Dec 13, 2019
  2. vexx32 commented on Dec 13, 2019

    @vexx32
    Collaborator

    Being able to do something like 'foo'.Split | Get-Help would be great, but, unfortunately, the resulting PSMethodInfo instances contain no information about the enclosing type.

    Possibly we could extend PSMethodInfo to include a reference to the type it was found in?

  3. added
    WG-Interactive-HelpSystem
    on Dec 13, 2019
  4. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  5. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  6. added
    Resolution-No Activity
    on Nov 16, 2023
  7. microsoft-github-policy-service commented on Nov 23, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-EnhancementResolution-No ActivityWG-Interactive-HelpSystem

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions