Skip to content

Online support for about_... help topics #13550

Closed

Description

Get-Help can display both locally cached help files and online resources.
Since online resources do not require prerequisites like Update-Help and are always up-to-date, and since online resources are much better formatted and include navigation to discover related items, a "Copy" button to copy&paste sample code, and more, many users default to using online help, i.e. by adding this to their profile:

$PSDefaultParameterValues.Add("Get-Help:Online",$true)

Now, without any prerequisites, users can easily display cmdlet help in an extra window like so:

dir -?
Get-Process -?

However, Get-Help -Online can only show help topics with a dedicated URI property. That's why all about_... topics fail to display even though there are online versions available.

Steps to reproduce

help Get-process -Online # works
help about_for -Online #fails

Expected behavior

When Get-Help is used with -Online, it should detect whether the requested help starts with about_ and then construct the appropriate URI rather than fail. This could be done with a hard-coded topic list to include only the MSFT about_ topics, or simply done heuristically with the potential of failing for about topics from 3rd party.

If all else fails and there is no match, Get-Help -Online should default to the PowerShell documentation home page: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core This would enable users to try and search there rather than being left with a red exception.

Get-Help about_for -Online # should open https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_for
Get-Help about_doesnotexist -Online # should open https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core

Actual behavior

Get-Help -Online fails for any topic that has no distinct URI property

Environment data


Name                           Value
----                           -----
PSVersion                      7.0.3
PSEdition                      Core
GitCommitId                    7.0.3
OS                             Microsoft Windows 10.0.18363
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0


Activity

  1. added
    Issue-Question
    on Aug 31, 2020
  2. Jaykul commented on Aug 31, 2020

    @Jaykul
    Contributor

    This has been asked before. It would be nice if it didn't get closed this time (see #10306). Maybe we can just agree on some format for embedding the URLs into about_*.txt files (or about*_.md?) as part of the markdown help stories?

  3. added
    WG-Interactive-HelpSystem
    on Aug 31, 2020
  4. iSazonov commented on Aug 31, 2020

    @iSazonov
    Collaborator

    We add a comment header #11205 (comment) with meta information.
    If we switched to Markdown it would be more simple.

  5. TobiasPSP commented on Aug 31, 2020

    @TobiasPSP
    CollaboratorAuthor

    Adding a comment to the about topics with the URI seems to be a great workaround until eventually there is a switch to md format.

  6. yecril71pl commented on Nov 9, 2020

    @yecril71pl
    Contributor

    We add a comment header #11205 (comment) with meta information.

    What do you mean by that? The comment says we could add…

    By the English grammar (We drink tea every morning), it looks like we added it every day, only to be undone overnight, hence no progress ☹

  7. Jaykul commented on Nov 21, 2020

    @Jaykul
    Contributor

    Andy (@AndASM) your problem is you're trying to get help for a module you can't import -- please start a new issue instead of hijacking this one.

  8. deadlydog commented on Nov 24, 2020

    @deadlydog

    Just an FYI for others that come across this and think about defaulting Get-Help -Online to $true, it currently breaks VS Code. See this issue for more info.

  9. mklement0 commented on Sep 24, 2021

    @mklement0
    Contributor

    Sean Wheeler (@sdwheeler) states in MicrosoftDocs/PowerShell-Docs#2939 (comment) that the about_* help source files have now been updated with URL information; alas, the downloaded versions still lack this information.

    As a temporary workaround, the following may be of interest:

    I've created a Show-Help function that is essentially a wrapper for Get-Help -Online, but it supports about_* topics too, whose URLs it constructs behind the scenes; e.g. Show-Help about_pwsh (tab-completion supported).

    It's available from an MIT-licensed Gist - assuming you have looked at the code (which I can personally assure you is safe, but you should always check), you can install it directly:

    irm https://gist.github.com/mklement0/880624fd665073bb439dfff5d71da886/raw/Show-Help.ps1 | iex
    

    See also these related suggestions:

    I've also created helper functions for these; here are all three installation commands:

    # Show-Help function (wrapper for Get-Help -Online with support for about_* topics); e.g.
    #     Show-Help about_pwsh
    #     Show-Help about_Automatic_Variables PSItem
    irm https://gist.github.com/mklement0/880624fd665073bb439dfff5d71da886/raw/Show-Help.ps1 | iex
    
    # Show-OperatorHelp function (online help for PowerShell's operators; e.g.
    #    Show-OperatorHelp replace
    irm https://gist.github.com/mklement0/146f3202a810a74cb54a2d353ee4003f/raw/Show-OperatorHelp.ps1 | iex
    
    # Show-TypeHelp function (online documentation for .NET types and instances); e.g.
    #    Show-TypeHelp regex
    #    Show-TypeHelp datetime tostring
    irm https://gist.github.com/mklement0/50a1b101cd53978cd147b4b138fe6ef4/raw/Show-TypeHelp.ps1 | iex
  10. 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.

  11. 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.

  12. 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.

  13. added
    Resolution-No Activity
    on Nov 16, 2023
  14. Jaykul commented on Nov 16, 2023

    @Jaykul
    Contributor

    This one really should not be closed -- instead, it should be implemented.

  15. 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-QuestionResolution-No ActivityWG-Interactive-HelpSystem

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions