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

Status : 

 


2
0
Sign in
to vote
ID 770675 Comments
Status Active Workarounds
Type Suggestion Repros 0
Opened 11/10/2012 3:26:03 AM
Access Restriction Public

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
Sign in to post a comment.