Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Online support for about_... help topics #13550

Closed
TobiasPSP opened this issue Aug 31, 2020 · 12 comments
Closed

Online support for about_... help topics #13550

TobiasPSP opened this issue Aug 31, 2020 · 12 comments
Labels
Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Resolution-No Activity Issue has had no activity for 6 months or more WG-Interactive-HelpSystem help infrastructure and formatting of help

Comments

@TobiasPSP
Copy link
Collaborator

TobiasPSP commented Aug 31, 2020

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


@TobiasPSP TobiasPSP added the Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a label Aug 31, 2020
@Jaykul
Copy link
Contributor

Jaykul commented Aug 31, 2020

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?

@iSazonov iSazonov added the WG-Interactive-HelpSystem help infrastructure and formatting of help label Aug 31, 2020
@iSazonov
Copy link
Collaborator

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

@TobiasPSP
Copy link
Collaborator Author

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.

@yecril71pl
Copy link
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 ☹

@Jaykul
Copy link
Contributor

Jaykul commented Nov 21, 2020

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

@deadlydog
Copy link

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.

@mklement0
Copy link
Contributor

@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

Copy link
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.

2 similar comments
Copy link
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.

Copy link
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.

@microsoft-github-policy-service microsoft-github-policy-service bot added Resolution-No Activity Issue has had no activity for 6 months or more labels Nov 16, 2023
@Jaykul
Copy link
Contributor

Jaykul commented Nov 16, 2023

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

Copy link
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
Labels
Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Resolution-No Activity Issue has had no activity for 6 months or more WG-Interactive-HelpSystem help infrastructure and formatting of help
Projects
None yet
Development

No branches or pull requests

6 participants