Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $dupes = gi $args[0] | gci -File -Recurse | group Name | ? {$_.Count -gt 1}
- gi $args[0] | gci -Directory | ? {
- $allDupes = $true
- $hasAny = $false
- $_ | gci -File | % {
- $folder = $_
- $hasAny = $true
- If (!($dupes | ? {$_.Name -eq $folder.Name})) {$allDupes = $false}
- }
- $allDupes -and $hasAny
- }
- .albumdupes.ps1 'C:UsersBenTestalbumtest'
- Directory: C:UsersBenTestalbumtest
- Mode LastWriteTime Length Name
- ---- ------------- ------ ----
- d----- 11/20/2017 2:00 PM Album C
- d----- 11/20/2017 2:01 PM Album F
Add Comment
Please, Sign In to add comment