String was not recognized as a valid DateTime error when using get-messagetrackinglog
Today I was using the get-messagetrackinglog PowerShell command and it returned the following error:
Cannot process argument transformation on parameter ‘Start’. Cannot convert value “25/07/2013 03:00:00” to type “System.DateTime”. Error: “String was not recognized as a valid DateTime.”
+ CategoryInfo : InvalidData: (:) [Get-MessageTrackingLog], ParameterBindin…mationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Get-MessageTrackingLog
Clearly I have specified the date and time correctly but it didn’t take me long to realise that this was probably due to the fact I had specified the date using the UK DD/MM/YYYY format and by default PowerShell uses the US MM/DD/YYYY format. I tested this theory by changing the dates from 25/07/2013 to 07/25/2013 and the command executed successfully.
Thank you for this , I was struggling with the same issue until I got to your post.