Many thanks. I tried this and there was a Timespan returned, but it just showed the total I originally added. What I need is the sum of the two. I am sorry if I am missing something very basic here.
That will return the hour as an integer which you could then add hours to get a running total. Without knowing the purpose of the result, it’s hard to suggest other solutions.
If you want to use a date/time object, it’s concerned about the date and time, so I don’t think you’ll find a way without adding hours, minutes and seconds separately.
This is workable, as I can format the TotalHours,TotalMinutes,TotalSeconds returned to a usable result. As I said earlier the result I am after here is 33:10:01 in this example. I cannot use (Get-Date) as it returns an hour from the next day if the total exceeds 24 hours.
I have now cobbled together a working script which demonstrates what I am trying to achieve; and just for good measure there is also a subtract function: