I'm trying to create a powershell script that takes the contents of a csv file, and compares it with the contents of each individual csv file in a folder. The goal here is to stop a system from processing a file if a file that has the same exact contents is already in this particular folder.
At the very basic, I've been able to compare the contents of one file against another with this:
$file1 = Get-Content C:\test.csv -raw
$file2 = Get-Content C:\test1.csv -raw
if ($file1 -eq $file2) {
Write-Host "They are the same"
Has anyone been able to accomplish something like this?
Thanks,