Powershell: Issues with Get-unique
Posted on 2010-11-15
I have two questions regarding the get-unique cmdlet.
If I have a txt file with 100 computer names with duplicates I want the duplicates to be removed.
I have the following lines but they do not remove duplicates properly.
[array]$colComputers = get-content "c:\temp\ISP\listAllComputers.txt" | Sort-Object | Get-Unique
no duplicates are removed. Am I using this right?
Is there a way to invoke the get-unique where it does not care or check for uppercase or lowercase?
For example with the following txt file entries:
there will be only two ouputs
thanks in advance,