Get-Help should find help files under $pshome#3528
Get-Help should find help files under $pshome#3528mirichmo merged 2 commits intoPowerShell:masterfrom chunqingchen:bugfix3
Conversation
There was a problem hiding this comment.
If we use SilentlyContinue we do not need to use Test-Path.
We can move New-Item's in BeforeAll:
BeforeAll {
$helpFile = "about_testCase.help.txt"
New-Item -ItemType Directory -Path "$PSHOME\en-US" -ErrorAction SilentlyContinue
New-Item -ItemType File -Path "$PSHOME\en-US\$helpFile" -Value "about_test" -ErrorAction SilentlyContinue
}There was a problem hiding this comment.
Please move it to AfterAll.
There was a problem hiding this comment.
Please remove the extra line.
There was a problem hiding this comment.
Can we verify the exact value instead of $null?
There was a problem hiding this comment.
Should this be:
$helpContent | Should Not BeNullOrEmptyThere was a problem hiding this comment.
Please clarify - is "Module" hardcoded for searching help files? And do this folder always exist? Maybe we should New-Item for it too?
|
I restarted MacOS because it appeared to have an issue downloading dotnet cli |
|
@chunqingchen please verify this also addresses #2649 |
There was a problem hiding this comment.
Should be as follows to avoid output on console.
$null = New-Item -ItemType Directory -Path "$PSHOME\en-US" -ErrorAction SilentlyContinue
There was a problem hiding this comment.
Should this be:
$helpContent | Should Not BeNullOrEmpty|
@adityapatwardhan your comments are resolved |
There was a problem hiding this comment.
Is this test case only meant to run on en-US? If it is, then you should skip it for non-English runs. Otherwise, please use (get-uiculture).Name.
There was a problem hiding this comment.
This check should probably be $helpContent | Should Match "about_test"
|
@Francisco-Gamino thanks, your comments are resolved |
There was a problem hiding this comment.
Also, does this tests run on Linux? If it does, then please use Join-Path instead of "$path\value"
E.g.,
$helpContentPath = join-path $PSHOME $culture
if (-not (test-path $helpContentPath))
{
}
|
@Francisco-Gamino thanks, your comment is resolved ! |
|
@Francisco-Gamino && @adityapatwardhan Do you guys have any more concerns or is this ready for merge? |
Francisco-Gamino
left a comment
There was a problem hiding this comment.
Please update this path $modulePath\en-US to $modulePath(get-uiculture).name. Other than that, it looks good. Thanks.
| Describe "Validate about_help.txt under culture specific folder works" -Tags @('CI') { | ||
| BeforeAll { | ||
| $modulePath = "$pshome\Modules\Test" | ||
| $null = New-Item -Path $modulePath\en-US -ItemType Directory -Force |
There was a problem hiding this comment.
This path should be $modulePath(get-culture).name
|
@chunqingchen Changes approved. |
|
@Francisco-Gamino en-us is replaced with culture |
Relevant issue: #2653 #2649
Steps to reproduce
get-help should be able to find the latest help files under $pshome
Actual behavior
get-help only get the files from C:\Windows\System32\WindowsPowerShell\v1.0
Environment data