Hi All,
I have an imported CSV file, example:
Project, StartDate, StartTime, EndDate, EndTime, Duration
Project 1, 19122018, 16:39:26, 19122018, 16:39:28, 00:01.8
Project 2, 19122018, 16:39:28, 19122018, 16:39:29, 00:00.3
Project 3, 19122018, 16:39:29, 19122018, 16:39:29, 00:00.4
Project 4, 19122018, 16:39:29, 19122018, 16:39:29, 00:00.3
Project 5, 19122018, 16:39:29, 19122018, 16:39:30, 00:00.3
Project 6, 19122018, 16:39:30, 19122018, 16:39:30, 00:00.3
Project 1, 19122018, 16:39:30, 19122018, 16:39:31, 00:00.5
Project and StartDate can occur multiple times, are subject to change and will not be known ahead of time.
I am trying to determine the total duration of each project on each day. I am encountering an issue as the duration is imported as a string rather then a timespan or similar, this is preventing me from performing a sum.
The below is as far as I was able to get.
$output = (Import-CSV -Path $script:csvPath -Delimiter ",") | Group-Object -property StartDate,Project foreach ($name in $output) { write-host $name.name "," $name.Group.Duration }
Is anyone able to suggest a way to achieve the desired result?
Thanks in advance