Quantcast
Channel: Exchange Server 2013 - Administration, Monitoring, and Performance 论坛
Viewing all articles
Browse latest Browse all 8719

Why does PowerShell ignore the system date and time format?

$
0
0
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?



Viewing all articles
Browse latest Browse all 8719

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>