Get-help may return multiple instances of the same help file - #3410
Conversation
32d47f6 to
6f8da8a
Compare
…le if it existed under a culture path and the parent was in the search path as well
6f8da8a to
5fdf27f
Compare
|
|
||
| It "Get-Help about_should should return help text and not multiple HelpInfo objects" { | ||
|
|
||
| $help = Get-Help about_should |
There was a problem hiding this comment.
Should we use an existing file for the test? Could we create temporary files?
There was a problem hiding this comment.
Since the test itself relies on Pester, I think it would be ok to depend on it.
There was a problem hiding this comment.
My thought was that if someone is going to have to improve Help System and to rename this file, the test will fail while has no relationship to the improvements.
There was a problem hiding this comment.
about_should belongs to Pester so we wouldn't rename it. I can create test only help files to replace this. I agree it would be more clean that way.
|
@PowerShell/area-helpsystem |
|
I'll have to debug this on a Mac |
7f2e5f0 to
b7d6098
Compare
b7d6098 to
c6fb535
Compare
|
Ilya (@iSazonov) you ready to approve the changes? |
|
Steve Lee (@SteveL-MSFT) I cannot repo the Issue locally and don't still understand a root of the Issue. I run the test in PowerShell Core without the fix and the test doesn't fail. 😕 |
|
Ilya (@iSazonov) did you run on Linux? It doesn't repro on Windows |
|
Oh, I only test on Windows. Sorry, I do not have the opportunity to build on Unix. |
|
Steve Lee (@SteveL-MSFT): The change LGTM. Thanks Steve for making this change! |
|
Francisco Gamino (@Francisco-Gamino) can you mark |
…ell#3410) * Help was incorrectly returning multiple instances of the same help file if it existed under a culture path and the parent was in the search path as well * updated test to use generated help file rather than an actual one * Fixed test to have module in $pshome path and casing of en-US culture
While building directories to search it may add the default shell directory twice to the list of directories to search (this is more of a perf issue of searching it twice than the root cause of the problem)
When a file is found, it generates a new unique key, however, the unique key is based on the root folder and not the actual one that contains the file, so a duplicate can result.
Addresses #3399