Is it possible to generate a JSON object for each file (with path) in a folder with it's MD5?

        "Name": "Games.dll",
        "md5": "4cd9e9a5efad4cceb01b3e41a047e489"
    }, {
        "Name": "Files/Image/Bg.png",
        "md5": "4cd9e9a5efad4cceb01b3e41a047e489"

This should do what you need

Get-ChildItem -File -Recurse | Get-FileHash -Algorithm MD5 | Select-Object @{name="Name";expression={$_.Path}}, @{name="md5";expression={$_.Hash}} | ConvertTo-Json

|improve this answer|||||

How to create a json file that contains file name, path, and md5 hash of all files in a folder using PowerShell 5.1

Takes a little more than one second per file.

pushd $env:userprofile\desktop
Get-FileHash (gci *.*) -Algorithm MD5 | convertto-json | out-file hash.json

powershell hash md5

powershell generate a JSON object for each file

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.