I have generated the list of MD5 checksum values from a directory within my project using Powershell's Get-FileHash function and then I exported the values to a .csv file.
$path = "C:\Users\Krishnaa\Documents\Visual Studio 2012\Projects\NamePrint\NamePrint\obj\Debug"
$hash = Get-FileHash -Path $path\* -Algorithm MD5
$export = $hash | Export-csv $path\hashfile.csv
This is how the output looks like if I call on $hash
: https://i.stack.imgur.com/Owi0Q.png
Then I imported the .csv file back to the Powershell console.
$import = Import-csv $path\hashfile.csv | Format-Table
And when I call on $import
, it outputs this : https://i.stack.imgur.com/cqvsO.png
When I created a simple function of my own to compare both the contents, I encounter problem whereby it says the the contents do not match. I do understand that each line in a .csv is treated as an object by Powershell. How to compare object-to-object in Powershell?