title: Moving items left and right from two listboxes
body: <p>I have a Gui with 2 listboxes like so:
  <a href="https://i.stack.imgur.com/yZuKv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yZuKv.png" alt="enter image description here" /></a></p>
  <p>This should be an installer where the user pick programs from left move them to the right and select install, and all the programs to the right will be installed.
  I have a problem with the button functions moving from left to right and from right to left. When I do this:</p>
  <pre><code>Function MoveRight (){
         $x = $listbox1.selecteditems
         @($x) | ForEach-Object {[void] $Listbox2.Items.Add($_)}}
  </code></pre>
  <p>I get the items to the right but when the user presses that button again I see duplication there.
  I'm struggeling with how can I make it test if the selected items on the left already exists on the right and if so just ignore that.</p>
  <p>I cannot do a check if listbox1.selecteditem eq to listbox2.selecteditem because the user will isn't supposeded to check items from listbox2 (unless he wants to remove them).</p>
  <p>Any idea how can I accomplish that?</p>