Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions test/powershell/engine/Help/HelpSystem.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -272,5 +272,29 @@ Describe "Get-Help should find pattern help files" -Tags "CI" {
)
$command.Invoke() | Should Be $result
}
}

Describe "Get-Help should find pattern alias" -Tags "CI" {
# Remove test alias
AfterAll {
Remove-Item alias:\testAlias1
}

It "Get-Help should find alias as command" {
(Get-Help where).Name | Should BeExactly "Where-Object"
}

It "Get-Help should find alias with ? pattern" {
$help = Get-Help wher?
$help.Category | Should BeExactly "Alias"
$help.Synopsis | Should BeExactly "Where-Object"
}

It "Get-Help should find alias with * pattern" {
Set-Alias -Name testAlias1 -Value Where-Object
$help = Get-Help testAlias1*
$help.Category | Should BeExactly "Alias"
$help.Synopsis | Should BeExactly "Where-Object"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add Remove-Item alias:\testAlias1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

}

}