I live in the UK where we use the dd/mm/yyyy date format and although my Exchange server's OS is set to use UK date format my PowerShell commands insist on using the US format -mm/dd/yyyy.
For example, if I run the following command:
Get-MessageTrackingLog -Start "30/04/2015"
I get the error:
Cannot process argument transformation on parameter 'Start'. Cannot convert value "30/04/2015" to type "System.DateTime". Error: "String was not recognized as a valid DateTime."
If I reformat the date thus it works fine:
Get-MessageTrackingLog -Start "04/30/2015"
It seems that PowerShell is ignoring the system date and time format.
Anyone got a fix for this?
For example, if I run the following command:
Get-MessageTrackingLog -Start "30/04/2015"
I get the error:
Cannot process argument transformation on parameter 'Start'. Cannot convert value "30/04/2015" to type "System.DateTime". Error: "String was not recognized as a valid DateTime."
If I reformat the date thus it works fine:
Get-MessageTrackingLog -Start "04/30/2015"
It seems that PowerShell is ignoring the system date and time format.
Anyone got a fix for this?