title: Find array elements which values are not part of another array PowerShell
body: <p>I have two arrays</p>
  <ul>
  <li><p><code>$adg</code> - (A list of AD groups)</p>
  </li>
  <li><p><code>$dbs</code> - (A list of database names)</p>
  </li>
  </ul>
  <p>Lets say I use this command
  <code>$adg -match $dbs.i</code></p>
  <p>The output will be all the AD groups which have the string <code>$dbs</code> in its name.</p>
  <p>However, I am aiming to find the DBs in which are not part of the AD groups array.</p>
  <p>Eg:</p>
  <pre><code>$adg = @(&quot;Dev22_Owner&quot;,&quot;Test49_Owner&quot;,&quot;Rocket_Owner&quot;)
  $dbs = @(&quot;Dev22&quot;, &quot;Confidential&quot;, &quot;InternDB&quot;, &quot;Rocket&quot;, &quot;Test49&quot;)
  </code></pre>
  <p>What approach should I take to get the output:</p>
  <blockquote>
  <p><code>Confidential</code></p>
  <p><code>InternDB</code></p>
  </blockquote>
  <p>I tried <code>$dbs | Where $adg -notmatch $dbs.i</code> but there is no output.</p>