title: How to collect activated checkboxes in powershell
body: <p>I am using a WPF Application, made in Visual Studio, in Powershell. I am trying to figure out how I can collect activated checkboxes and run a command based on the selection. For now, I am trying to display a message that will show a user their selection to confirm before proceeding to the next step. For some odd reason,</p>
  
  <p><code>if ($checkbox.checked -eq $true)</code> does not work. </p>
  
  <p>What i am trying to recreate is, if I have a listbox with the following checkboxes (all unchecked when the form starts):</p>
  
  <p><code>Apples
  Oranges
  Bananas</code></p>
  
  <p>and the user selects <code>Apples</code> &amp; <code>Bananas</code>, I would like a message box to show that the user has selected <code>Apples &amp; Bananas</code>.</p>
  
  <p><code>[System.Windows.Forms.MessageBox]::Show(" show what the user has selected in this line"   , "selection")})</code></p>
  
  <p>and run commands that would be programmed to those selection.</p>
  
  <p>for a more appropriate context, i am creating a GUI to add users to certain groups (the checkboxes to allow addition to multiple groups at once). I would like to let the user know exactly what user groups they have selected before proceeding to add to those respective groups.</p>
  
  <p>Any help is appreciated, thank you!</p>