Repository navigation
Description
See also:
- Extend Get-Help to support focused lookup of documentation for PowerShell operators #11339
- Online support for about_... help topics #13550
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:
- the close integration between PowerShell and .NET types in general
- that there's no easy way to look up the types that PowerShell cmdlets outputs (
MatchInfocomes to mind as a complex type whose documentation needs to be consulted to take full advantage of it - see also: Online versions of cmdlet help topics should link to the documentation for their output types in the "Outputs" section MicrosoftDocs/PowerShell-Docs#5221).
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-Helpcurrently binds the-Nameparameter 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-InputObjectparameter whose (distinct set of ) types are to be looked up should work.- Being able to do something like
'foo'.Split | Get-Helpwould be great, but, unfortunately, the resultingPSMethodInfoinstances contain no information about the enclosing type.
- Being able to do something like
-
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
vexx32 commentedon Dec 13, 2019
Possibly we could extend
PSMethodInfoto include a reference to the type it was found in?microsoft-github-policy-service commentedon Nov 16, 2023
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.
microsoft-github-policy-service commentedon Nov 16, 2023
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.
microsoft-github-policy-service commentedon Nov 23, 2023
This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.