Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

How to refine a list to the most recent unique items in PowerShell

$
0
0

I'm sure this has been covered, so my apologies...

I have a list where some items may show up more than once, but I just the status of the most recent one.

I've tried $list | sort date -descending | sort item -unique, but it didn't work consistently

Example
date,item,status

6/14,orange,rotten

6/14,apple,ripe

6/13,orange,ripe

I'd just like my list to contain

6/14,orange,rotten

6/14,apple,ripe


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>