PowerShell Script to Get Hash Values of Multiple Files in Multiple Folders
top of page

PowerShell Script to Get Hash Values of Multiple Files in Multiple Folders


Here's a PowerShell script that you can use to get the MD5 hash values of multiple files that are in a directory with multiple levels of subfolders:

PS C:\Users\SeanKOShea> Get-FileHash -Algorithm MD5 -Path (Get-ChildItem "C:\FooFolder\baseball2\*.*" -Recurse -force) | export-csv c:\FooFolder\Batch01b.csv

The Get-FileHash algorithm can be set to generate MD5, SHA1 and other hash values. Follow this command with the folder containing your source files. This will work even if the files are saved in multiple subdirectories, thanks to the, 'Recurse -force'. Enter a pipe | and then use the export-csv command to output the results to a comma separated value file.

The .csv file that is generated will look like this:

This PowerShell script will work if you list different directories in multiple copies of this one line script, put them on separate lines in PowerShell, and run them all at once.


Sean O'Shea has more than 20 years of experience in the litigation support field with major law firms in New York and San Francisco.   He is an ACEDS Certified eDiscovery Specialist and a Relativity Certified Administrator.

​

The views expressed in this blog are those of the owner and do not reflect the views or opinions of the owner’s employer.

​

If you have a question or comment about this blog, please make a submission using the form to the right. 

Your details were sent successfully!

© 2015 by Sean O'Shea . Proudly created with Wix.com

bottom of page