title: Detect if-else output PowerShell
body: <p>I'm trying to make a PowerShell string to compile a program and if it's correctly compiled, I want to open the the program. The problem that I'm trying to solve is to understand how PowerShell understands when the <a href="http://mingw.org/" rel="nofollow noreferrer">MiniGW</a> compiler with <code>gcc</code> command (for C files) throws a correct result.</p>
  
  <p>Knowing that <code>== TRUE</code> and <code>== FALSE</code> are not accepted in PowerShell I tried an <code>if</code> without any logical operator</p>
  
  <pre><code>if(gcc '.\FileINeedToCompile.c'){
    Write-Host Correct;
  } else {
    Write-Host NotCorrect;
  }
  </code></pre>
  
  <p>but I get the <code>NotCorrect</code> result in the case that the program is correctly compiled and also the case it's not compiled.</p>
  
  <p>I've also tried some varietions with the logical operator <code>-eq</code> like</p>
  
  <p><code>if((gcc '.\FileINeedToCompile.c') -eq $FALSE)</code></p>
  
  <p>but I get always the result of the <code>else</code> statement.</p>
  
  <p>I searched everywhere and I really don't know how I could make this working.
  Thanks for help.</p>