Select item from dynamic multidimensional arraylist

This topic contains 1 reply, has 2 voices, and was last updated by  Jack Neff 3 years ago.

  • Author
  • #22658


    I have an arraylist that is dynamic. It is created from the results of a get-mailboxexport command. Each entry has 3 values. 2 will definitely contain duplicate values and the other will potentially contain duplicates.

    I only need to use 2 of the values however. So I have an Identity value and a status value. I need to be able to find all duplicate identity's where at least one status is 'Failed'.

    I found this example $arrPies | Group-Object | Where-Object {$_.Count -gt 1} but it doesn't quite seem to fit this situation. So I have tried this:

    foreach ($i in $test)

    {select-object -identity | group-object | where-object {$i.count -gt 1}



    This still does not return any value. At this time I am not comparing the Status value, just wanting it to select any items where there are duplicate identities.

  • #22667

    Jack Neff

    Your first example was close but you should specify the property that Group-Object should focus on like:

    $arr | Group-Object -Property Identity | Where-Object {$_.Count -gt 1}

You must be logged in to reply to this topic.