title: Powershell variable interrogation of date & time difference
body: <p>Morning All,</p>
  
  <p>I have a variable as follows: <code>$machines = $user2,$name,$serial,$purchased</code>
  sample data stored in $machines is:</p>
  
  <pre><code>User1,
  Laptop1,
  xyz1234,
  01/01/2010
  </code></pre>
  
  <p>I am wanting to create a new variable called $tobereplaced containing all of the records in $machines with a date greater than 4 years old from todays date.</p>
  
  <p>the fuzzy logic code for this im expecting to be someting like <code>$tobereplaced = $machines.$purchased | where {$_$purchased = -getdate &gt; 4 years}</code> etc etc but i cant quite figure it out.</p>
  
  <p>Assistance would be greatly appreciated.</p>
  
  <p>Thanks</p>