title: Compare two string variables in PowerShell
body: <p>I have two variables in sorted order.</p>
  
  <p><code>$a</code> contains</p>
  
  <pre><code>Gi1/1
  Gi1/2
  </code></pre>
  
  <p><code>$b</code> contains</p>
  
  <pre><code>Gi1/1
  Gi1/2
  Gi1/3
  </code></pre>
  
  <p>I tried to compare two variables whether it is equal or not equal as below:</p>
  
  <pre><code>if($a -eq $b) {
      write-host "equal"
  } else {
      write-host "not equal"
  }
  </code></pre>
  
  <p>but it didn't seem to work. The output should be "not equal", but it outputs as "equal". How can I fix this?</p>