Sort Array of objects

Hey

(Powershell)

I have an array contaning:

Computer Date
PC1             01-02-2012
PC2             02-04-2012
PC3             01-03-2013

I need to get the 2 oldest computers returned.

Howto?

Mike
LVL 1
mikeydkAsked:
Who is Participating?
 
oBdACommented:
$array | Sort-Object -Property Date | Select-Object -First 2

Open in new window

1
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.