{"id":20680275,"url":"https://github.com/markwragg/powershell-hashcopy","last_synced_at":"2025-08-21T11:32:41.080Z","repository":{"id":34044661,"uuid":"143699157","full_name":"markwragg/PowerShell-HashCopy","owner":"markwragg","description":"A PowerShell module for copying files between two paths that have been determined to have changed via computed hash value comparison.","archived":false,"fork":false,"pushed_at":"2024-10-28T16:19:54.000Z","size":135,"stargazers_count":44,"open_issues_count":2,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-29T00:32:00.445Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markwragg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"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-08-06T08:31:19.000Z","updated_at":"2024-10-28T16:19:58.000Z","dependencies_parsed_at":"2024-09-07T12:54:02.141Z","dependency_job_id":"f498a7f6-0198-4c17-a9d1-d5586738b98c","html_url":"https://github.com/markwragg/PowerShell-HashCopy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwragg%2FPowerShell-HashCopy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwragg%2FPowerShell-HashCopy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwragg%2FPowerShell-HashCopy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwragg%2FPowerShell-HashCopy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markwragg","download_url":"https://codeload.github.com/markwragg/PowerShell-HashCopy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230511479,"owners_count":18237657,"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":[],"created_at":"2024-11-16T21:30:45.498Z","updated_at":"2024-12-19T23:13:21.931Z","avatar_url":"https://github.com/markwragg.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PowerShell-HashCopy\n\n[![Build Status](https://dev.azure.com/markwragg/GitHub/_apis/build/status/markwragg.PowerShell-HashCopy?branchName=master)](https://dev.azure.com/markwragg/GitHub/_build/latest?definitionId=2\u0026branchName=master) ![Test Coverage](https://img.shields.io/badge/coverage-92%25-brightgreen.svg?maxAge=60)\n\nThis PowerShell module contains cmdlets for copying and comparing specific files between two paths, where those files have been determined to have changed via a computed hash value. This is useful if you need to sync specific file changes from one directory to another but cannot trust the modified date of the files to determine which files have been modified (for example, if the source files has been cloned from a source control system and as a result the modified dates had changed). \n\nYou should of course be confident that if there is a difference between two files, it is the copy you have specified as being in the source `-Path` that you want to use to overwrite the copy in the `-Destination` path. New files (files that exist in the source path but not in the destination) will also be copied across, including any directories in their paths that may be missing in the destination folder.\n\nYou can synchronise an entire directory tree by using the `-Recurse` parameter.\n\n# Installation\n\nThe module is published in the PSGallery, so if you have PowerShell 5 or newer can be installed by running:\n\n```\nInstall-Module HashCopy -Scope CurrentUser\n```\n\n## Usage\n\n### Copy-FileHash\n\nYou can use the `Copy-FileHash` cmdlet to sync a single path by providing it with `-Path` and `-Destination` parameters:\n```\nCopy-FileHash -Path C:\\Some\\Files -Destination D:\\Some\\Other\\Files\n```\nThis will compute the hash for all files in each directory (and all sub-directories, due to `-Recurse`) via the `Get-FileHash` cmdlet and then will copy any changed and new files from the source path to the destination path. \n\nYou can include all the sub-folders of the source `-Path` by adding `-Recurse`:\n```\nCopy-FileHash -Path C:\\Some\\Files -Destination D:\\Some\\Other\\Files -Recurse\n```\n\nYou can specify a `-LiteralPath` instead of a Path if you want to avoid wildcard characters from being interpreted as such:\n```\nCopy-FileHash -LiteralPath C:\\Some\\Files -Destination D:\\Some\\Other\\Files -Recurse\n```\n\nYou can remove files from the Destination path that are not in the Source path by adding `-Mirror`:\n```\nCopy-FileHash -Path C:\\Some\\Files -Destination D:\\Some\\Other\\Files -Mirror\n```\n\nYou can have the destination file objects returned by adding `-PassThru`:\n```\nCopy-FileHash -Path C:\\Some\\Files -Destination D:\\Some\\Other\\Files -Recurse -PassThru\n```\n\nYou can Force the overwrite of read-only files in the Destination path by adding `-Force`:\n```\nCopy-FileHash -Path C:\\Some\\Files -Destination D:\\Some\\Other\\Files -Force\n```\n\nYou can specify the algorithm that `Get-FileHash` uses to create the Hash by using `-Algorithm`:\n```\nCopy-FileHash -Path C:\\Some\\Files -Destination D:\\Some\\Other\\Files -Algorithm MD5\n```\nValid `-Algorithm` values are: SHA1 | SHA256 | SHA384 | SHA512 | MACTripleDES | MD5 | RIPEMD160.\n\n### Compare-FileHash\n\nIf you'd like to check which files will be copied from a source path before actually using `Copy-FileHash`, you can use `Compare-FileHash`. This cmdlet outputs file objects for any new or modified file having performed the same comparison as the `Copy-` cmdlet (e.g via using Get-FileHash of the source and destination file to determine if they are different).\n\nCheck which files would be copied from one single directory to another:\n```\nCompare-FileHash -Path C:\\Some\\Files -Destination D:\\Some\\Other\\Files\n```\nCheck which files would be copied between one directory tree and another (including all sub-directories):\n```\nCompare-FileHash -Path C:\\Some\\Files -Destination D:\\Some\\Other\\Files -Recurse\n```\n\nAs with `Copy-FileHash` you can use `-LiteralPath` instead of `-Path` to have paths interpreted literally.\n\n## Cmdlets\n\nA full list of cmdlets in this module is provided below for reference. Use `Get-Help \u003ccmdlet name\u003e` with these to learn more about their usage.\n\nCmdlet           | Description\n-----------------| -------------------------------------------------------------------------------------------------------\nCopy-FileHash    | Copies any files between two directory paths that are new or have changed based on computed hash value.\nCompare-FileHash | Compares files from one location to another based on determining change via computed hash value.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkwragg%2Fpowershell-hashcopy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkwragg%2Fpowershell-hashcopy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkwragg%2Fpowershell-hashcopy/lists"}