title: how can i handle compare-object result?
body: <p>I made a lot of searches before posting with no luck.
  Let's suppose I want to compare two folders</p>
  
  <pre><code>compare-object @(gci c:\folder1) @(gci c:\folder2) 
  </code></pre>
  
  <p>I see the output with sideIndicator and so on but how can I do something like</p>
  
  <pre><code>if objects are equals then
    do something
  else
    do something else
  end if
  </code></pre>
  
  <p>if I pipe this cmdlet to get-member I see an equals method but I don't know how to use it and I'm not even sure if it could solve my problem. Is there any boolean property that tells me if objects are equals or not?
  Thanks for your time.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Hi my saviour. :)
  If I have understood I had to do something like this:</p>
  
  <pre><code>$differences = 0
  $a = @(1,4,5,3)
  $b = @(1,3,4)
  diff $a $b -in | % {if($_.sideindicator -ne "==") {$differences+=1}}
  write-host $differences
  </code></pre>
  
  <p>Is this the only way?</p>
  
  <p><strong>EDIT 2.</strong></p>
  
  <p>It seems to me that if I don't use -includeEqual I get only the differences, so this code suffices.</p>
  
  <pre><code>$differences = 0
  $a = @(1,4,5,3)
  $b = @(1,3,4)
  diff $a $b  | % {$differences+=1}
  write-host $differences
  </code></pre>
  
  <p>and it returns 0 if objects are equals. Is it the right way to solve my problem? </p>