You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected this to work because -First is typed as [int] and [int]$null evaluates to 0 in powershell. But these tests demonstrate that implicit casting of parameters does not behave in that manner nor consistently.
That line happens to have been changed in 344aee6 to this:
&$SafeCommands['Select-Object'] -First $count
That change is inconsequential to this problem, though, and this problem existed prior to that change in the original 77b84c9.
Fix
I have a working fix which is simply a matter of initializing $count. This restores the helpful output error message as follows:
I'll create a PR as soon as I (re)figure out the right way to do that.
The text was updated successfully, but these errors were encountered:
Repro
Describe describe { It outer { It inner { $true } } }
Results in this error:
Analysis
The originating block of code uses variable
$count
. That line was originally written as part of #426 in 77b84c9 like this:I expected this to work because
-First
is typed as[int]
and[int]$null
evaluates to0
in powershell. But these tests demonstrate that implicit casting of parameters does not behave in that manner nor consistently.That line happens to have been changed in 344aee6 to this:
That change is inconsequential to this problem, though, and this problem existed prior to that change in the original 77b84c9.
Fix
I have a working fix which is simply a matter of initializing
$count
. This restores the helpful output error message as follows:I'll create a PR as soon as I (re)figure out the right way to do that.
The text was updated successfully, but these errors were encountered: