0

I need to compare the content of files on 2 different machines. There are around 50 files in the folder on each PC. So far I have done this:

compare (gc \\PC1\d$\Data\Config\*) (gc \\PC2\d$\Data\Config\*) | Out-GridView

and it works fine, but in that way I can't see in which file the difference exist. So I need the filename in the result.

techraf
  • 4,403
Kennet
  • 1

1 Answers1

0

If files under folder "...\Config" are same . You may need to compare with each file :

Edited:

Get-ChildItem \\PC1\d$\Data\Config\* | %{$path1 = "\\PC1\d$\Data\Config\$($_.name)" ;$path2 = "\\PC2\d$\Data\Config\$($_.name)" ; $dif = compare (gc $path1) (gc $path2);if ($dif) {$_.name;$dif}}