{"id":21698607,"url":"https://github.com/theohbrothers/get-duplicateitem","last_synced_at":"2025-04-12T12:42:25.247Z","repository":{"id":38476848,"uuid":"137310559","full_name":"theohbrothers/Get-DuplicateItem","owner":"theohbrothers","description":"Gets duplicate or non-duplicate files.","archived":false,"fork":false,"pushed_at":"2025-02-13T11:22:38.000Z","size":94,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T07:22:18.446Z","etag":null,"topics":["duplicate","duplicate-files","hash","powershell","pwsh","search","unique","unique-files"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theohbrothers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-14T05:33:38.000Z","updated_at":"2025-02-21T06:40:43.000Z","dependencies_parsed_at":"2024-06-16T19:02:05.831Z","dependency_job_id":"d314052c-1f24-430c-8290-967e3f603271","html_url":"https://github.com/theohbrothers/Get-DuplicateItem","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theohbrothers%2FGet-DuplicateItem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theohbrothers%2FGet-DuplicateItem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theohbrothers%2FGet-DuplicateItem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theohbrothers%2FGet-DuplicateItem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theohbrothers","download_url":"https://codeload.github.com/theohbrothers/Get-DuplicateItem/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248569046,"owners_count":21126159,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["duplicate","duplicate-files","hash","powershell","pwsh","search","unique","unique-files"],"created_at":"2024-11-25T19:35:27.143Z","updated_at":"2025-04-12T12:42:25.214Z","avatar_url":"https://github.com/theohbrothers.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Get-DuplicateItem\n\n[![github-actions](https://github.com/theohbrothers/Get-DuplicateItem/actions/workflows/ci-master-pr.yml/badge.svg?branch=master)](https://github.com/theohbrothers/Get-DuplicateItem/actions/workflows/ci-master-pr.yml)\n[![github-release](https://img.shields.io/github/v/release/theohbrothers/Get-DuplicateItem?style=flat-square)](https://github.com/theohbrothers/Get-DuplicateItem/releases/)\n[![powershell-gallery-release](https://img.shields.io/powershellgallery/v/Get-DuplicateItem?logo=powershell\u0026logoColor=white\u0026label=PSGallery\u0026labelColor=\u0026style=flat-square)](https://www.powershellgallery.com/packages/Get-DuplicateItem/)\n\nGets duplicate or non-duplicate files.\n\n## Install\n\nOpen [`powershell`](https://docs.microsoft.com/en-us/powershell/scripting/windows-powershell/install/installing-windows-powershell?view=powershell-5.1) or [`pwsh`](https://github.com/powershell/powershell#-powershell) and type:\n\n```powershell\nInstall-Module -Name Get-DuplicateItem -Repository PSGallery -Scope CurrentUser -Verbose\n```\n\n## Usage\n\nThe cmdlet supports the same parameters as `Get-ChildItem`: `-Path`, `-LiteralPath`, `-Include`, `-Exclude`, and `-Recurse`.\n\nUse the `-AsHashtable` switch to get a hashtable containing `[string]$md5 = [System.Collections.ArrayList]$files`.\n\n```powershell\n# Get duplicate files in 'C:/folder1' only\nGet-DuplicateItem -Path 'C:/folder1'\n\n# Alternatively, you may pipe folder paths\n'C:/folder1' | Get-DuplicateItem\n\n# Or DirectoryInfo objects\nGet-Item 'C:/folder1' | Get-DuplicateItem\n\n# Get duplicate files in 'C:/folder1' and its descendents\nGet-DuplicateItem -Path 'C:/folder1' -Recurse\n\n# Get duplicate files in 'C:/folder1' and its descendents in the form: hash =\u003e FileInfo[]\nGet-DuplicateItem -Path 'C:/folder1' -Recurse -AsHashtable\n\n# Remove all duplicate items\nGet-DuplicateItem -Path 'C:/folder1' | Remove-Item\n\n# Remove all duplicate files in 'C:/folder1' and its descendents\nGet-DuplicateItem -Path 'C:/folder1' -Recurse | Remove-Item\n```\n\nUse the `-Inverse` switch to get non-duplicates.\n\n```powershell\n# Get non-duplicate files in 'C:/folder1' only\nGet-DuplicateItem -Path 'C:/folder1' -Inverse\n\n# Get non-duplicate files in 'C:/folder1' and its descendents\nGet-DuplicateItem -Path 'C:/folder1' -Inverse -Recurse\n\n# Get non-duplicate files in 'C:/folder1' and its descendents in the form: hash =\u003e FileInfo[]\nGet-DuplicateItem -Path 'C:/folder1' -Inverse -Recurse -AsHashtable\n\n# Remove all non-duplicate files in 'C:/folder1' only\nGet-DuplicateItem -Path 'C:/folder1' -Inverse | Remove-Item\n\n# Remove all non-duplicate files in 'C:/folder1' and its descendents\nGet-DuplicateItem -Path 'C:/folder1' -Inverse  -Recurse | Remove-Item\n```\n\n## Notes\n\nThe cmdlet calculates the md5 hash of each descendent file, to be able to identify duplicates and non-duplicates. Therefore if there are many large descendent files, it is normal for the Cmdlet to take several seconds to several minutes to complete.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheohbrothers%2Fget-duplicateitem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheohbrothers%2Fget-duplicateitem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheohbrothers%2Fget-duplicateitem/lists"}