Function Show-WinForm([Array]$objectArray){
#$objectArray = @($input)
#Ensure that they've piped information into the script
if($objectArray.Count -eq 0 )
{
Write-Error "This script requires pipeline input." ;
return
}
#load the windows Forms assembly
[void][Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms");
##Create the main form
$form = New-Object Windows.Forms.Form
$form.Size = New-Object System.Drawing.Size @(600,600);
#Create the listBox to hold the items form the pipeline
$listbox = New-Object System.Windows.Forms.CheckedListBox;
$listbox.CheckOnClick = $true
$listbox.Dock = 'Fill' ;
$form.Text = "Select the list of objects you wish to pass down the pipeline"
$listbox.Items.AddRange($objectArray);