Use Powershell to find a file by its version data

I am looking for a specific version of a file, which our build process outputs. I'm looking for a file which has both File Version and Product version set to a specific value in the format x.x.x.x

I can't seem to find a PowerShell command/parameter to pass in which will allow me to specify either of these attributes.

6

1 Answer

I achieved this by running the following in PowerShell

gci -recurse | where { $_.VersionInfo.FileVersion -eq 'x.x.x.x' }

This returned me a list of files with the expected version.

Kudos to @lieven & @belthazar for the tips.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like