Get-Help should find help files under pshome (#3528)

This commit is contained in:
Chunqing Chen
2017-05-01 13:54:01 -07:00
committed by Mike Richmond
parent 11ad02a15a
commit 5a82b10fc7
2 changed files with 28 additions and 13 deletions
@@ -201,3 +201,28 @@ Describe "Validate about_help.txt under culture specific folder works" -Tags @('
$help | Should BeExactly "Hello"
}
}
Describe "Get-Help should find help info within help files" -Tags @('CI', 'RequireAdminOnWindows') {
It "Get-Help should find help files under pshome" {
$helpFile = "about_testCase.help.txt"
$culture = (Get-Culture).Name
$helpFolderPath = Join-Path $PSHOME $culture
$helpFilePath = Join-Path $helpFolderPath $helpFile
if (!(Test-Path $helpFolderPath))
{
$null = New-Item -ItemType Directory -Path $helpFolderPath -ErrorAction SilentlyContinue
}
try
{
$null = New-Item -ItemType File -Path $helpFilePath -Value "about_test" -ErrorAction SilentlyContinue
$helpContent = Get-Help about_testCase
$helpContent | Should Match "about_test"
}
finally
{
Remove-Item $helpFilePath -Force -ErrorAction SilentlyContinue
}
}
}