Hello,
I would like to compare 2 csv values (Names and MD5).
The script I do have so far does not what I aim for. I want it to display whether the values match or not and for each action to export as csv file.
Could help me on this please.
Below is my script
$file1 = import-csv "C:\pathtofile.csv"
$file2 = import-csv "C:\Users\users\Desktop\file.csv"
Compare-Object -ReferenceObject $file1 -DifferenceObject $file2 -Property 'Name', 'Hash' -IncludeEqual
first check that properties match (can omit this step if you know for sure they will be)
if(Compare-Object $file1.Hash -eq $file2.Hash)
{
trow "Properties are not the same!" $file1.Hash $file2.Hash
}
pass properties list to Compare-Object
else
{
Compare-Object $file1 $file2 -Property Hash
}