Hi,
I'm trying to compare dates in a script. Since the dates come out of a .csv-file, I cast them to [datetime]:
$dag=[DateTime] $user.lastlogin
but I get an error :
"Cannot convert value "10/09/2008 15:23" to type "System.DateTime".Error: "De tekenreeks is niet als geldige DateTime herkend.", which is Dutch for "The string is not recognised as a valid DateTime."
However, when I type the same line at the prompt, it works perfect: when I look into $dag, it says:
"maandag 10 september 2007 15:23:00"
What's the difference between the prompt and the line in a script???