troubleshooting Question

how can i recover an object -  looking up on a property - out of an array of custom objects ?

Avatar of Erwin Pombett
Erwin PombettFlag for Switzerland asked on
2 Comments2 Solutions100 ViewsLast Modified:

how can i recover an object like we do in linq out of list of custom objects.

$collaborators = Import-Csv $PSScriptRoot/collaborateur.csv -Delimiter ';' 

$PeopleInObjects = @()

foreach($collabo in $collaborators)
    $pObject = New-Object  PSObject

    $pObject | Add-Member -MemberType NoteProperty "Matricule"       $collabo.Matr
    $pObject | Add-Member -MemberType NoteProperty "Firstname"       $collabo.Prenom
    $pObject | Add-Member -MemberType NoteProperty "LastName"        $collabo.Nom

    $PeopleInObjects += $pObject 

// here how can i recover one object after it's lastname ?

thank you in advance
"Batchelor", Developer and EE Topic Advisor
Join our community to see this answer!
Unlock 2 Answers and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros