title: Powershell: delete duplicate entry in arraylist
body: <p>In my Powershellscript I read some data from a csv-File in an Arraylist.</p>
  
  <p>In the second step I eliminate every line without the specific char: <code>(</code>.</p>
  
  <p>At the third step I want to eliminate every double entries.</p>
  
  <p>Example for my list:</p>
  
  <pre><code>Klein, Jürgen (Klein01); salesmanagement national 
  Klein, Jürgen (Klein01); salesmanagement national 
  Meyer, Gerlinde (Meyer02); accounting 
  Testuser 
  Admin1
  Müller, Kai (Muell04); support international
  </code></pre>
  
  <p>I use the following script: </p>
  
  <pre><code>$Arrayusername = New-Object System.Collections.ArrayList
  $NewArraylistuser = New-Object System.Collections.ArrayList
  $Arrayusername = Get-Content -Path "C:\Temp\User\Userlist.csv"
  for ($i=0; $i -le $Arrayusername.length; $i++)
  {
      if ($Arrayusername[$i] -like "*(*")
      {
          $NewArraylistuser.Add($Arrayusername_ads[$i])
      }
      $Array_sorted = $NewArraylistuser | sort
      $Array_sorted | Get-Unique
  }
  </code></pre>
  
  <p>But the variable <code>$Array_sorted</code> still has double entries.
  I don´t find the mistake.</p>