Skip to content

Instantly share code, notes, and snippets.

@mattwoolnough
Last active September 21, 2017 23:50
Show Gist options
  • Save mattwoolnough/45ff0ff0a62b5f4084b72122ce48e444 to your computer and use it in GitHub Desktop.
Save mattwoolnough/45ff0ff0a62b5f4084b72122ce48e444 to your computer and use it in GitHub Desktop.
Compare hashes of files in two directories (recursive)
$SourceDocs = Get-ChildItem -Recurse –Path "\\172.16.97.19\c$\Program Files\Folder to Check\" | foreach {Get-FileHash –Path $_.FullName}
$DestDocs = Get-ChildItem -Recurse –Path "C:\Program Files\Program Files\Folder to Check\" | foreach {Get-FileHash –Path $_.FullName}
(Compare-Object -ReferenceObject $SourceDocs -DifferenceObject $DestDocs -Property hash -PassThru).Path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment