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.
gc \\PC1\d$\Data\Config\*returns unstructured array of lines from all files in\\PC1\d$\Data\Configfolder; the same holds forgc \\PC2\d$\Data\Config\*. Therefore you can't grab filenames. You need to compare individually, file by file taken fromGet-ChildItemcmdlet.