Change Get-Help cmdlet -Parameter parameter so it accepts string arrays. (#8454)

This commit is contained in:
Sergey Vasin
2019-01-15 16:25:49 -08:00
committed by Aditya Patwardhan
parent c2dfae8ccb
commit 279993bf39
3 changed files with 55 additions and 8 deletions
@@ -478,6 +478,31 @@ Describe 'help can be found for AllUsers Scope' -Tags @('Feature', 'RequireAdmin
}
}
Describe "Get-Help should accept arrays as the -Parameter parameter value" -Tags @('CI') {
BeforeAll {
$userHelpRoot = GetCurrentUserHelpRoot
## Clear all help from user scope.
Remove-Item $userHelpRoot -Force -ErrorAction SilentlyContinue -Recurse
UpdateHelpFromLocalContentPath -ModuleName 'Microsoft.PowerShell.Core' -Scope 'CurrentUser'
## Delete help from global scope if it exists.
$currentCulture = (Get-Culture).Name
$coreHelpFilePath = Join-Path $PSHOME -ChildPath $currentCulture -AdditionalChildPath 'System.Management.Automation.dll-Help.xml'
if (Test-Path $coreHelpFilePath) {
Remove-Item $coreHelpFilePath -Force -ErrorAction SilentlyContinue
}
}
It "Should return help objects for two parameters" {
$help = Get-Help -Name Get-Command -Parameter Verb, Noun
$help | Should -HaveCount 2
$help[0].Name | Should -BeExactly 'Verb'
$help[1].Name | Should -BeExactly 'Noun'
}
}
Describe "Help failure cases" -Tags Feature {
It "An error is returned for a topic that doesn't exist: <command>" -TestCases @(
@{ command = "help" },