title: Deleting rows from a table if it contains values from another table
body: <p>I am interning for a company and they tasked me with a challenge of finding rows in a table containing values from another table and delete them with Powershell and not using SQL. For example:</p>
  <p>Product Table 1</p>
  <pre><code>    pName    | pCode | pPrice
  Product 1.1  | 10001 |  3.99
  Product 1.2  | 10007 |  5.49
  Product 1.3  | 10009 |  3.00
  </code></pre>
  <p>Product Table 2</p>
  <pre><code>    pName    | pCode | pPrice
  Product 2.1  | 10002 |  0.49
  Product 2.2  | 10007 |  2.99
  Product 2.3  | 10053 |  9.00
  </code></pre>
  <p>I need to remove the entire row of Product 2.2 from Table 2 since Table 1 contains its product code 10007.</p>
  <p>I am thinking about creating a hash table, loop through each line in Table 2 and add them into this new hash table if they don't contain the same value found in Table 1, and finally export the hash table into a new csv file. My pseudo code:</p>
  <pre><code>$Output = @{}
  $Table1 = IMPORT Table1.csv 
  $Table2 = IMPORT Table2.csv
  
  FOREACH ($Line in $Table2) {
     IF (!($Table1 -Contains $Table2[$Line]))
     $Output = Add-Content($Table2[$Line])
  }
  
  $Output | Export-Csv 
  </code></pre>
  <p>However I am completely new to PowerShell and I don't know much about the syntaxes of it. Can anyone help me with a somewhat valid code? Thank you very much.</p>