In simple terms, you want the intersection of the two sets.
You haven't provided the names of the CSV columns that hold the names of the software, or the names of any other columns. This code will produce the intersection of the sets and export only the values that appear in both of the sets. It doesn't output a CSV, but just the values in the intersection.
$Ref = @{}
$Intersection = @{}
# populate the reference set
Import-CSV c:\junk\ReferenceSoftware.csv |
ForEach-Object{
$Ref[$_.RefSoftwareName] = ""
}
# process the difference set
# and find the intersection of the sets
Import-Csv c:\junk\DifferenceSoftware.csv |
ForEach-Object{
if ($Ref.ContainsKey($_.DifSoftwareName)){
$Intersection[$_.DifSoftwareName] = "" # populate the intersection
}
}
$Intersection.Keys |
Out-File c:\junk\Intersection.txt