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
{{ message }}
Repository navigation
It should be possible to discover (print) the overloads of the intrinsic ForEach and Where array methods #14376
Invoking a method type member without (...) outputs System.Management.Automation.PSMethod`1 instances describing the method's signatures (overloads), which is helpful in interactive discovery; e.g.:
However, this doesn't currently work for the intrinsic .ForEach() and .Where() array methods implicitly available on all objects (though tab-completion does recognize them); e.g., (1, 2).ForEach returns $null
(As a side effect, with Set-StrictMode -Version 2 or higher, (1, 2).ForEachfails outright; conceptually related: #2798)
Steps to reproduce
(1,2).ForEach| Should -Not-BeNullOrEmpty
(1,2).Where| Should -Not-BeNullOrEmpty
Expected behavior
Both tests should pass.
Actual behavior
Both tests fails, because both expressions evaluate to $null instead of outputting System.Management.Automation.PSMethod`1 instances.
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
Activity
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 23, 2023
This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.