You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Get-Help cannot open if there are duplicates #11205
Committee-ReviewedPS-Committee has reviewed this and made a decisionIssue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreWG-Interactive-HelpSystemhelp infrastructure and formatting of help
Dustin Watkins (@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. 🙂
The behaviour arises because Get-Help acts as a search when it finds two help files by the same name. I would think that the behaviour should be:
If the name provided matches multiple entries, and the names of the returned entries are identical, then
The most up to date (by version I suppose) entry should be automatically selected. Otherwise,
Return to current behaviour (allow multiple entries to be displayed when there is more than one match).
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.
Good points, Rain Sallow (/u/ta11ow) (@vexx32); with side-by-side module installations, a way to target a specific version is definitely called for.
Ilya (@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?
There's also a bit more background in this Stack Overflow answer.
Worth noting that the problem only affects conceptual help topics (about_*, more generally, presumably all HelpFile category files, *.help.txtfiles).
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 $env:PSModulePath examined in sequence, highest version wins among multiple versions installed in the same folder), and no duplicates occur.
There are additional oddities:
WinPS apparently always lists the about topics from its $PSHOME folders first.
PS Core now seems to ignore a $PSHOME version if one is installed with a module that comes first in $env:PSModulePath; however, with the very specific combination of installing PSReadLine 1.2 alongside 2.0.0-beta6 (Install-Module PSReadLine -Force -SkipPublisherCheck), I can still reproduce the symptom in PowerShell Core 7.0.0-preview.6
Generally, it seems that *.help.txt files are even picked up in irregularly named folders (not named for module versions) that the module auto-loader ignores.
Here's a quick helper function that finds all help files by file-name substring (e.g., Get-HelpFile psReadline).
functionGet-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 Help folder. In the case of PSReadLine, you have one under your personal powershell\help folder and the other in <modulepath>\help. I think it makes sense to prefer the updateable help version in the case of a dupe, but we still have the problem #1 above.
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.
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 commented on 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 commented on 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.
Committee-ReviewedPS-Committee has reviewed this and made a decisionIssue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreWG-Interactive-HelpSystemhelp infrastructure and formatting of help
Activity
vexx32 commentedon Nov 27, 2019
Dustin Watkins (@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. 🙂
alexandair commentedon Nov 27, 2019
Yes, it could be reproduced in the latest preview:
rkeithhill commentedon Nov 28, 2019
This bug just won't go away. WTH? You can workaround the bug like so:
But seriously, this bug needs to be fixed.
vexx32 commentedon Nov 28, 2019
/cc Steve Lee (@SteveL-MSFT)
The behaviour arises because
Get-Helpacts as a search when it finds two help files by the same name. I would think that the behaviour should be: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.
iSazonov commentedon Nov 28, 2019
It seems we already have such issue.
mklement0 commentedon Nov 29, 2019
Good points, Rain Sallow (/u/ta11ow) (@vexx32); with side-by-side module installations, a way to target a specific version is definitely called for.
Ilya (@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?
There's also a bit more background in this Stack Overflow answer.
Worth noting that the problem only affects conceptual help topics (
about_*, more generally, presumably allHelpFilecategory files,*.help.txtfiles).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
$env:PSModulePathexamined in sequence, highest version wins among multiple versions installed in the same folder), and no duplicates occur.There are additional oddities:
WinPS apparently always lists the about topics from its
$PSHOMEfolders first.PS Core now seems to ignore a
$PSHOMEversion if one is installed with a module that comes first in$env:PSModulePath; however, with the very specific combination of installingPSReadLine 1.2alongside2.0.0-beta6(Install-Module PSReadLine -Force -SkipPublisherCheck), I can still reproduce the symptom in PowerShell Core 7.0.0-preview.6Generally, it seems that
*.help.txtfiles are even picked up in irregularly named folders (not named for module versions) that the module auto-loader ignores.Here's a quick helper function that finds all help files by file-name substring (e.g.,
Get-HelpFile psReadline).SteveL-MSFT commentedon Aug 25, 2020
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
Helpfolder. In the case of PSReadLine, you have one under your personalpowershell\helpfolder and the other in<modulepath>\help. I think it makes sense to prefer the updateable help version in the case of a dupe, but we still have the problem #1 above.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.
4 remaining items
vexx32 commentedon Aug 26, 2020
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.
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 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.