title: Compare-Object API response with text file shows everything is different
body: <p>I have a Web API that returns an HTML string which I want to compare with a html file on my local machine.</p>
  <p>To do so, I have the following code</p>
  <pre><code>$Result = (Invoke-WebRequest `
                  -Uri &quot;{uri}&quot; `
                  -Headers @{&quot;some-header&quot;, &quot;some-value&quot;}).Content
  
  $TestContent = Get-Content -Path ($RepositoryLocation + &quot;index.html&quot;) -Raw
  $Equal = Compare-Object -ReferenceObject $TestContent -DifferenceObject $Result
  </code></pre>
  <p>When I now use <code>Write-Hosts $Equal</code> it displays me that the whole content is different</p>
  <p>When I use <code>Write-Host $Equal.SideIndicator</code> it displays me <code>=&gt; &lt;=</code> which also indicates that the complete file is different</p>
  <p>Furthermore, using the command with <code>-IncludeEqual -ExcludeDifferent</code> displays empty result, so like I said, no lines are the same.</p>
  <hr />
  <p>So what I tried next was to save the Content of <code>$Result</code> into a text file and compare them then, but still, it told me, that the whole file is different.</p>
  <hr />
  <p>I then used diffchecker.com as well as JetBrains IDEs integrated comparison tool, to check for differences. Both tools told me that the content is identical. I'm losing my mind, why does PowerShell tell me they have complete different content?</p>
  <p>Sadly, I cannot post the content of the API response as well as the content of the index.html</p>
  <hr />
  <p>What I thought maybe could be the reason is</p>
  <ul>
  <li>Encoding, however both are UTF8</li>
  <li>Line endings, however no diff if I use CL, CL RF or RF on the file</li>
  <li>Some hidden characters (tabs instead of spaces) but I activated to see that on JetBrains IDE and they still are identical.</li>
  </ul>
  <p>How do I know what's causing this issue here?</p>