title: Make select -unique on arraylist return arraylist instead of string
body: <p>I have three arraylists in below class. I want to keep them unique. However if there's only one item (string) in the arraylist and you use select -unique (or any other method to achieve this) it will return the string instead of a list of strings. Surrounding it with @() also doesn't work because that transforms it to an array instead of an arraylist, which I can't add stuff to.</p>
  
  <p>Any suggestions that are still performant? I tried HashSets before but somehow had horrible experiences with those. See my previous post for that.. <a href="https://stackoverflow.com/questions/58880295/powershell-hashset-members-wrongly-cast-to-hashset?noredirect=1#comment104063826_58880295">Post on hashset issue</a></p>
  
  <p>Code below:</p>
  
  <pre><code>Class OrgUnit
  {
      [String]$name
      $parents
      $children
      $members
  
  
      OrgUnit($name){
          $this.name = $name
          $this.parents = New-Object System.Collections.ArrayList
          $this.children = New-Object System.Collections.ArrayList
          $this.members = New-Object System.Collections.ArrayList
      }
  
      addChild($child){
          # &gt; $null to supress output
          $tmp = $this.children.Add($child)
          $this.children = $this.children | select -Unique
      }
  
      addParent($parent){
          # &gt; $null to supress output
          $tmp = $this.parents.Add($parent) 
          $this.parents = $this.parents | select -Unique
      }
  
      addMember($member){
          # &gt; $null to supress output
          $tmp = $this.members.Add($member)
          $this.members = $this.members | select -Unique
      }
  }
  </code></pre>