Last active
May 15, 2020 13:56
-
-
Save pipelinedave/8ddba82d220aa019269a808103244c3d to your computer and use it in GitHub Desktop.
powershell / Get duplicates from a csv file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$data = Import-Csv -path .\test.csv | |
$unique = $data | Select-Object -Unique | |
$data | Where-Object { $_ -notcontains $unique } | |
Compare-Object -ReferenceObject $data -DifferenceObject $unique -IncludeEqual | Where-Object { $_.SideIndicator -eq "==" } | Select-Object -ExpandProperty InputObject |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment