I wont to go though a array and remove any object/value which is duplicated in the array.
I try this code the convert the string into array
$a = "a,b,a,c,d,a,g,G,h,A,,,,"
$option = [System.StringSplitOptions]::RemoveEmptyEntries
$a= $a.Split(",", $option);
$a= $TextInfo.ToTitleCase($a.Trim())
Then I use following to remove any values which is duplicated
$a = $a | Select-Object -Unique
Which is hit and miss on some list, its working for some list but then for some it doesn't.
Would like to have a array with no duplicate values