-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Get-Help cannot open if there are duplicates #11205
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
Comments
@watkins656 can you reproduce this issue in the latest stable or preview versions of PowerShell? 5.1 is a legacy version and is not being actively maintained. 🙂 |
Yes, it could be reproduced in the latest preview:
|
This bug just won't go away. WTH? You can workaround the bug like so:
But seriously, this bug needs to be fixed. |
/cc @SteveL-MSFT The behaviour arises because
Additionally, we should probably expose the version of the module that this help is coming from so as to provide a way to distinguish the files, and provide a way for Get-Help to target a specific version should it be required. |
It seems we already have such issue. |
Good points, @vexx32; with side-by-side module installations, a way to target a specific version is definitely called for. @iSazonov: Yes, the issue at hand was originally reported in #9215, but since there's more information here now, can you please close #9215 as a duplicate? Worth noting that the problem only affects conceptual help topics ( With cmdlet help topics, the same module version that the module auto-loading mechanism targets is apparently targeted (first module by that name in the folders listed in There are additional oddities:
Here's a quick helper function that finds all help files by file-name substring (e.g., function Get-HelpFile($fileNamePart) {
# Note the use of Split-Path -Parent, because help files can be in sibling
# folders of $env:PSModulePath folders.
Split-Path -Parent ($env:PSModulePath -split [IO.Path]::PathSeparator) |
Get-ChildItem -File -Recurse -Filter *$fileNamePart* |
Where-Object Name -match '(?:\.help\.txt|-help.xml)$'
} |
I took a look at this and unfortunately it's not so straightforward to fix. The problem is that as help is discovered, it is emitted. Since we don't know the order before hand if there are dupes, we don't know which of the duplicates is the right one to show until we have the full results. If we change this to a synchronous model where we filter first before displaying, then this breaks the current user experience where they see found results as they are found. This means that if there is a large set of results, you wouldn't see anything until the very end (we'd add a progress bar I suppose). Assuming we agree to break the user experience, there isn't any version information related to the module in updateable help. The help content is stored in a In the case where you have multiple versions of the same module in different places that have local help that gets found by the helpsystem, it would probably make sense to show the one from the path where the module is imported. All of this is not a small change. Moving out of 7.1 as I don't see such changes making it in time. |
So if user loaded new module version from another path it will get old help. I think we should do that we do to get a cmdlet version - go through a module manifest. |
@PowerShell/powershell-committee discussed this, we propose:
This allows the use case: get-help psreadline | select -first 1 | get-help |
That's a partial fix, but IMO unless a wildcard is present, Get-Help should do some basic filtering to ensure it doesn't output duplicate results. |
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. |
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. |
1 similar comment
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. |
This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes. |
Steps to reproduce
Expected behavior
There should be a way to open the help file, even with duplicates.
Actual behavior
Nothing can be opened
Environment data
Name Value
PSVersion 5.1.17134.858
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17134.858
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
The text was updated successfully, but these errors were encountered: