[PSv4] Dynamic filter methods instead of psv4's method syntax - by S.K. _

Status : 


Sign in
to vote
ID 798407 Comments
Status Active Workarounds
Type Suggestion Repros 0
Opened 8/24/2013 7:58:10 AM
Access Restriction Public


I can't understand benefit of psv4's method syntax.
for example,

(Get-Process).where("name -like p*").ID

is longer than

Get-Process | ? name -like p* | % ID

You might make '?' method in stead of 'where', but '?' is unsuited as a method name, I think.
So method syntax only added a function without benefits. This is harm. 

If method syntax are added, It must be more handy than pipeline syntax.
that is, method syntax must have simply syntax that can't do pipeline syntax
In pipeline filter syntax, what we can't omit is 'where'(or '?').
So I suggest 'dynamic filter methods' in order to omit 'where'.

they are defined { property name + operator(like, match, in, ne, lt, gt...etc ) },
 like { Name + Like }

for example,


this is very handy and TAB COMPLETION FRIENDLY, and this syantax never incarnate in pipeline syntax.

Yeah, you know, the implementation of this function will be very dirty.
But I like this function than psv4's method syntax which have no benefits.

Sign in to post a comment.