Only get a single instance in an array

Hi Guys,
Any help would be appreciated as I have no idea how to tackle this.
I am pulling storage space information from PRTG using a web API request.
I end up with an array with the below data.
1/01/2018 7:00:00 PM - 8:00:00 PM 5497289703424.00
1/01/2018 8:00:00 PM - 9:00:00 PM 5497289703424.00
1/01/2018 9:00:00 PM - 10:00:00 PM 5497289703424.00
1/01/2018 10:00:00 PM - 11:00:00 PM 5497289703424.00
1/01/2018 11:00:00 PM - 12:00:00 AM 5497289703424.00
2/01/2018 12:00:00 AM - 1:00:00 AM 5497289703424.00
2/01/2018 1:00:00 AM - 2:00:00 AM 5497289703424.00
2/01/2018 2:00:00 AM - 3:00:00 AM 5497289703424.00
2/01/2018 3:00:00 AM - 4:00:00 AM 5497289703424.00
2/01/2018 4:00:00 AM - 5:00:00 AM 5497289703424.00
2/01/2018 5:00:00 AM - 6:00:00 AM 5497289703424.00

I only want to keep the first line on each day. How could i remove the rest and accomplish this?

Thanks
Douglas

you could do something like this

$myarray = @(
(“1/01/2018 7:00:00 PM – 8:00:00 PM 5497289703424.00”),
(“1/01/2018 8:00:00 PM – 9:00:00 PM 5497289703424.00”),
(“1/01/2018 9:00:00 PM – 10:00:00 PM 5497289703424.00”),
(“1/01/2018 10:00:00 PM – 11:00:00 PM 5497289703424.00”),
(“1/01/2018 11:00:00 PM – 12:00:00 AM 5497289703424.00”),
(“2/01/2018 12:00:00 AM – 1:00:00 AM 5497289703424.00”),
(“2/01/2018 1:00:00 AM – 2:00:00 AM 5497289703424.00”),
(“2/01/2018 2:00:00 AM – 3:00:00 AM 5497289703424.00”),
(“2/01/2018 3:00:00 AM – 4:00:00 AM 5497289703424.00”),
(“2/01/2018 4:00:00 AM – 5:00:00 AM 5497289703424.00”),
(“2/01/2018 5:00:00 AM – 6:00:00 AM 5497289703424.00”)

)

$myarray | select -First 1

Thanks but i figured it. Funny how you leave it for a while and it comes to you when you are not thinking about it :slight_smile:

I ended up doing
$array | select “Date Time”, “Available Capacity(RAW)”, “Free Bytes(RAW)” | Where-Object {$_.“Date Time” -like “12:00:00 AM - 1:00:00 AM”}
This gave the one data point per day. So simple I don’t know why i didn’t see it earlier.

Thanks
Douglas

or you could just do
$myarray[0]