title: Powershell list app which is not installed by match and notmatch
body: <p>I would like to ask you how to list applications which are not installed from array with regex. Bellow is my code.</p>
  <ol>
  <li>I would like to list all instalation apps which match with $programy_zjisteni. Does it works</li>
  <li>I would like to list all not instalation apps which notmatch with $programy_zjisteni. Does not works.</li>
  </ol>
  <p>Maybe I should use soma filter? Or?</p>
  <p>Thank you for your help.</p>
  <pre><code>$nainstalovane_programy = (Get-WmiObject -Class Win32_Product).name
  
  #Programy, ktere kontroluji
  $programy_zjisteni = @(
          &quot;landesk.*Agent&quot;
          &quot;Logmanager Event Sender&quot;
          )
  
  $installed_programs = @()
  $not_installed_programs = @()
  
  foreach ($program in $nainstalovane_programy)
  {
      foreach ($x in $programy_zjisteni)
      {
          if ($program -match $x)
          {
              $installed_programs += $program
          }
          else
          {
              $not_installed_programs += $program 
          }
      }
  }
  
  $installed_programs
  $not_installed_programs
  </code></pre>