|
Re: Comparing dates with If The problem is that you're comparing strings, not dates
If you write
$Today = get-date
$90daysago = (get-date).AddDays(-90)
$Today -gt $90daysago
it returns correctly true but if you compare
01072009 with 10092008, the second string is greater than the first one. |