I would like to compare the version info of files from two different directories.
I could do this:
$files1 = (Get-Item "$path1\*.dll").VersionInfo
$files2 = (Get-Item "$path2\*.dll").VersionInfo
compare-object $files1 $files2
But then I get something like:
InputObject ----------- File: path1\AxInterop.ShDocVw.dll... File: path1\dom.dll... (etc...) File: path2\AxInterop.ShDocVw.dll... File: path2\dom.dll... (etc...)
I guess I could do something like:
$files1 = (Get-Item "$path1\*.dll").VersionInfo.ProductVersion
$files2 = (Get-Item "$path2\*.dll").VersionInfo.ProductVersion
compare-object $files1 $files2
$files1 = (Get-Item "$path1\*.dll").VersionInfo.FileVersion
$files2 = (Get-Item "$path2\*.dll").VersionInfo.FileVersion
compare-object $files1 $files2
but then if there is a difference, I'd have to go looking for what that difference is. I can't compare the files directly because one set is signed and the other isn't.
What would the best way to do this?
To clarify, the current compare-object
cmdlet doesn't meet my needs because it shows the filename as different because it shows that they have different paths. This is irrelevant to me.
I would like to compare rows with the same filename but different version numbers. If a difference in version number is observed for the same filename or a filename doesn't exist in one of the tables, then show the difference.