6

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"
    }
]
0

2 Answers 2

15

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

0
4

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
popd 
exit

powershell hash md5

powershell generate a JSON object for each file

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .