Uncategorized · August 16, 2018 0

get version of any file (dll or exe)

Hello and welcome to the powermator blog!

As administrator you may often need to chack the version of a specific file no matter what extention it has (I have tried it on dll, exe and ocx) to make sure that the right software is installed or the system is correctly patched and updated. today I will show you how its easy to do that with PowerShell. Basically all what we need to use is the command Get-Item. We will pass the file location as parameter

$someFile = "C:\Windows\System32\something.dll"

(Get-Item $someFile).VersionInfo.FileVersion

If you want to check a file or dll verion on a remote machine here is what I use

cls
$computerName = "somePC"

$someFile = "C:\Windows\System32\something.dll"

Invoke-Command -ComputerName $computerName -ScriptBlock {
Param($someFile)
(Get-Item $someFile).VersionInfo.FileVersion
} -ArgumentList $someFile

below is my screen output to show you how I have checked the version of an exe file remotely. (zoom your browser if needed to have better view).

thats it.

Cheers

Jaber

Close Bitnami banner
Bitnami