title: Troubleshooting if in powershell
body: <p>I am in a very strange powershell behavior.
  I have an If, elseif, else.
  The If works, The else if works, but the else never happened.</p>
  
  <p>What could it be?</p>
  
  <p>This is the script:</p>
  
  <pre><code>$result = Get-AMTHardwareAsset $Computer -credential $VProCredential -textoutput
  if ($result.Contains("Unauthorized") -eq $true)
      {
          Add-Results "$Computer`tHardwareAssets-Unauthorized"
      }
  elseif ($result.Contains("Could not connect") -eq $true)
      {
          Add-Results "$Computer`tHardwareAssets-CannotConect"
      }
  
      else
      {
          Add-Results "TESTING"
      }
  </code></pre>