0

This is what I am doing on linux

cat a-directory/* | md5

What would be the alternative in PowerShell, maybe something with CertUtil?

The reason I am doing this is that I want to make sure I can copy a large directory.

deralbert
  • 856
  • 2
  • 15
  • 33
user8369515
  • 485
  • 1
  • 5
  • 16
  • 4
    [Get-FileHash](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/get-filehash?view=powershell-7), but consider using [Robocopy](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy) instead of rolling your own solution. – vonPryz Jun 12 '20 at 12:16
  • `bash -c "cat directory | md5sum"` – Nico Nekoru Jun 12 '20 at 16:33
  • 2
    This definitely won't win any beauty awards, but at least returns the same result: `([System.Security.Cryptography.HashAlgorithm]::Create('MD5').ComputeHash([System.Text.Encoding]::UTF8.GetBytes((gc C:\a-directory\*.*) -join '')) | % { $_.ToString('x2') }) -join ''` – leeharvey1 Jun 14 '20 at 13:21

0 Answers0