Is it possible to search multiple folders to target versioninfo off a .dll

I know if I run this command:

$DLLPath = "C:\Windows\winsxs\x86_microsoft.vc80.atl_1fc8b3b9a1e18e3b_8.0.50727.762_none_11ecb0ab9b2caf3c\ATL80.dll"
(Get-Item $DLLPath).VersionInfo.FileVersion

It will tell me the version off: ATL80.dll

Is it possible to do a search in the C:Windows\winsxs and find any files with a certain version? For example, if ATL80.DLL has version 12345, I want to find any other .dlls in the winxsx that also have the same version.

I thought: select-string would do it but I am not getting the syntax right or there is another way.

 

In this special case I’d recommend to use the product version instead of the file version. As the file version used to have additional “info” in it you don’t need usually. (something like “(WinBuild.160101.0800)” or “(WinRelRS6.050727-9100)”)
So you’d end up with something like this:

Get-ChildItem -Path C:\Windows\WinSxS -Filter *.dll -Recurse -Force -ErrorAction SilentlyContinue |
    Where-Object {$_.VersionInfo.ProductVersion -eq [Version]'1.2.345.6789'} |
        Select-Object -Property @{Name='ProductVersion'; Expression = {$_.VersionInfo.ProductVersion}},FullName

Of course you need to adjust the version you’re looking for. :wink:

[quote quote=213036]In this special case I’d recommend to use the product version instead of the file version. As the file version used to have additional “info” in it you don’t need usually. (something like “(WinBuild.160101.0800)” or “(WinRelRS6.050727-9100)”)

So you’d end up with something like this:

PowerShell
3 lines
<textarea class="ace_text-input" style="left: 44px; top: 0px; width: 6.6px; height: 18px; opacity: 0;" spellcheck="false" wrap="off"></textarea>
1
2
3
Get-ChildItem -Path C:\Windows\WinSxS -Filter *.dll -Recurse -Force -ErrorAction SilentlyContinue |
Where-Object {$_.VersionInfo.ProductVersion -eq [Version]'1.2.345.6789'} |
Select-Object -Property @{Name='ProductVersion'; Expression = {$_.VersionInfo.ProductVersion}},FullName
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Of course you need to adjust the version you’re looking for. 😉

[/quote]

Thank you