title: Normalized file path comparison in Powershell
body: <p>Say I have the following two paths (both are valid, say):</p>
  
  <pre><code>$p1 = "D:\folder1\"
  $p2 = "D:\Folder1"
  </code></pre>
  
  <p>I want to compare these two paths for equality. I am expecting both paths to be the same. I tried both the commands below:</p>
  
  <ul>
  <li><code>(Resolve-Path $p1) -eq (Resolve-Path $p2)</code> </li>
  <li>(<code>Get-Item $p1) -eq (Get-Item $p2)</code> </li>
  </ul>
  
  <p>None returned <code>$True</code> because the backslash was not normalized. Now I know I can do some regex magic and make it work but all I am looking for is an in-built solution for comparing file paths.</p>