View Single Post
Old 01-07-2009   #2 (permalink)
sardinian_guy


Vista Home Premium 32bit
 
 

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.
My System SpecsSystem Spec