How can I remove duplicate values within an array element in PowerShell?
For example:
$array[0] = C1 C1 C3 C3
$array[1] = C1 C1 C2 C2
How can I removed the duplicates in Powershell, so that I have:
$array[0] = C1 C3
$array[1] = C1 C2
I tried $array[0] | Select -Unique but it was not successful. Nothing changed. With $array | Select - Unique the duplicates are removed without considering the single array elements.
Anyone a good idea?
C1 C1 C3 C3different property values or is it astring?$array[0] -split ' ' | select -unique.