All, for some reason I am not getting what I expected and would love to get some help if possible… Thanks in advance
Below is my test.csv file
risk_level email breach_added_date
Very High jim@abc.com 2020-07-25T20:00:44Z
low daveg@abc.com 2020-07-25T20:00:44Z
Very High daveg@abc.com 2018-07-25T20:00:44Z
Very High daveg@abc.com 2016-07-25T20:00:44Z
Very High jim@abc.com 2019-07-25T20:00:44Z
medium daveg@abc.com 2015-07-25T20:00:44Z
I run the below and all is good so far
Import-Csv c:\temp\eecpro\test.csv | sort email, breach_added_date -descending –Unique | export-csv test1.csv
then
import-csv test1.csv
risk_level email breach_added_date
Very High jim@abc.com 2020-07-25T20:00:44Z
Very High jim@abc.com 2019-07-25T20:00:44Z
low daveg@abc.com 2020-07-25T20:00:44Z
Very High daveg@abc.com 2018-07-25T20:00:44Z
Very High daveg@abc.com 2016-07-25T20:00:44Z
medium daveg@abc.com 2015-07-25T20:00:44Z
I run the below and this is what I get which is the issue…
import-csv eecpro1.csv | sort email -Unique
risk_level email breach_added_date
Very High daveg@abc.com 2018-07-25T20:00:44Z
Very High jim@abc.com 2020-07-25T20:00:44Z
I want the output to be like the below . Why is it grabbing daveg@abc.com with 2018-07-25T20:00:44Z like above and not 2020-07-25T20:00:44Z like below?
risk_level email breach_added_date
Very High daveg@abc.com 2020-07-25T20:00:44Z
Very High jim@abc.com 2020-07-25T20:00:44Z
Thanks again