Repository navigation
Expose the .ForEach() and .Where() methods as regular PowerShell operators - #126
Conversation
Follow-up from discussion at PowerShell/PowerShell#6576
|
|
||
|
|
||
| It's probably worth creating a new conceptual help topic titled `about_Collection_Operators` to describe these new operators. | ||
|
|
There was a problem hiding this comment.
Note: all of the comparison operators work with collections e.g. "a", "b", "c", "d" -match "[bc]" will return "b", "c".
There was a problem hiding this comment.
Bruce Payette (@BrucePay): Good point, but the new operators are not about also working on collections; their whole purpose is to operate on collections; additionally, their purpose is open-ended, given that the meat of the behavior is in the script blocks passed.
So my suggestion is to have the new topic mention the collection-processing capabilities of comparison operators such as -eq and -match and link to about_comparison_operators.
|
Michael Klement (@mklement0) I believe it makes sense to add a description of exception behavior in the operators. |
|
Ilya (@iSazonov): Thanks; I've added a note re error handling, operator precedence, and |
|
Currently, we on the @PowerShell/powershell-committee think that introducing what amounts to a third (or fourth) reference to "foreach" ( Instead, we think it's probably a good idea to come up with some ScriptAnalyzer rules and accompanying documentation that explain why it might not be a good idea to use |
|
Thanks for writing this, though Michael Klement (@mklement0). Very through provoking, and we're not opposed to ever doing it, but I am going to merge this one into the Rejected state now for posterity. |
As originally discussed in PowerShell/PowerShell#6576