The goal is to hash all files in a directory /s, output the hashes to a file, then use that file to compare hashes to a directory in another location. Can this be accomplished? Many utilities such as QuickSFV (old, not fully functional) or OpenHashTab can do this. It should be an option. Suggestions? Example photo included. TIA

You can use
Get-ChildItem, a for each loop and Get-FileHash
That is a good start :). Can you provide some detail? Which hashing do you recommend? My limited understanding is Powershell Get-FileHash is functional, and ‘CertUtil’ is an alternative. It is appreciated.
Edit: This creates the CSV. From there, how is it utilized to check against an alternate directory?
param ($folders = @("C:\temp_fotos\", "C:\fotos_temp\") #case sensitive)$allFiles = foreach($folder in $folders) {Get-Childitem -path $folder -recurse |select FullName,Name,Length,CreationTime,LastWriteTime |foreach {$hash = Get-FileHash $_.FullNameadd-member -InputObject $_ -NotePropertyName Hash -NotePropertyValue $hash.Hashadd-member -InputObject $_ -NotePropertyName RelativePath -NotePropertyValue $_.FullName.Replace($folder, '') -PassThru}}$allFiles | select -First 10 | ft RelativePath, Hash
It sounded like homework originally and now with the numbered commands I’m feeling stronger about that. Either way, you should know this forum is for helping users with issues they are facing with their code. It is not a script factory. If you have a specific point where you’ve hit a roadblock, please share that.
1 Like