-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
First-Time-IssueEasy issues first time contributors can work on to learn about this projectEasy issues first time contributors can work on to learn about this projectIssue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdlets-Corecmdlets in the Microsoft.PowerShell.Core modulecmdlets in the Microsoft.PowerShell.Core module
Description
Note: This is definitely a minor bug that won't arise too often in the real world.
Passing an all-whitespace -Name argument to Get-Command results in unexpected error message Get-Command: Index was outside the bounds of the array.
Steps to reproduce
{ Get-Command -ea Stop -Name ' ' } | Should -Throw -ErrorId CommandNotFoundExceptionExpected behavior
The test should succeed; that is, the usual CommandNotFoundException should be reported.
Actual behavior
The test fails, because the error mentioned above is reported instead.
Expected an exception, with FullyQualifiedErrorId 'CommandNotFoundException' to be thrown,
but the FullyQualifiedErrorId was
'System.IndexOutOfRangeException,Microsoft.PowerShell.Commands.GetCommandCommand'
Environment data
PowerShell Core 7.1.0-preview.5
vexx32 and jakekerr
Metadata
Metadata
Assignees
Labels
First-Time-IssueEasy issues first time contributors can work on to learn about this projectEasy issues first time contributors can work on to learn about this projectIssue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdlets-Corecmdlets in the Microsoft.PowerShell.Core modulecmdlets in the Microsoft.PowerShell.Core module