title: Powershell compare text files and write difference lines to a new file
body: <p><strong>File 1.txt</strong></p>
  
  <pre><code>Abc
  Def
  Xyz
  </code></pre>
  
  <p><strong>File 2.txt</strong></p>
  
  <pre><code>Xyz
  Def
  </code></pre>
  
  <p>Abc is not found in file 2 when file 1 is compared against file 2, So want to write Abc to a new file diff.txt.</p>
  
  <p><strong>diff.txt</strong></p>
  
  <pre><code>Abc
  </code></pre>
  
  <p>I saw many posts using compare-object but those are not producing outputs like what my requirement was. I am new to Powershell</p>