title: Powershell stop process using process age behaving wierd
body: <p>My little script works like this </p>
  
  <pre><code>$age = read-host "enter age"
  Get-Process | Where-Object { $_.Name -eq "notepad" -and ($_.starttime).totalminutes -le $age} | Stop-Process (New-TimeSpan -Start (get-process notepad).StartTime).totalminutes
  </code></pre>
  
  <p>If I change the <code>-le</code> to <code>-gt</code> or <code>-ge</code> (which is what I am trying to use) it will not kill the process... I don't really understand why this is not working.</p>
  
  <p>Can anyone share some insights?</p>
  
  <p>Thanks!</p>