title: PowerShell: Or Condition in While Loop
body: <p>I've a really simple problem, but i dont get it working. I have a loop which checks if one of two possible files is existing, if not then sleep and check again in two seconds.</p>
  
  <pre><code>while (([System.IO.File]::Exists($terminationFile) -ne $true) -or ([System.IO.File]::Exists($noFile) -ne $true)) {
      # wait 2 seconds and check again
      Start-Sleep -s 2
  }
  </code></pre>
  
  <p>If I check both conditions in the same loop it checks only the first one. </p>
  
  <p>Would be great if anybody can help</p>
  
  <p>Regards, 
  Justin</p>