Home Dashboard Directory Help
Search

$_.Index property for easy indexing by S.K. _


Status: 

Active


2
0
Sign in
to vote
Type: Suggestion
ID: 770675
Opened: 11/10/2012 3:26:03 AM
Access Restriction: Public
0
Workaround(s)
view

Description

Please add something to index pipe objects.

$_.Index, $%, $& and so on.




--Example--

PS > 1,3,4,5,7,9,10,11,13 | group { $_-$_.Index }

Count Name                     Group
----- ----                     -----
    1 1                         {1}
    3 2                         {3, 4, 5}
    1 3                         {7}
    3 4                         {9, 10, 11}
    1 5                         {13}


PS > $a = 6, 1, 7, 3, 2
PS > $b = 1, 5, 4, 4, 3

PS > $a | ? { $_ -gt $b[$%] }
6
7
Details
Sign in to post a comment.
Sign in to post a workaround.