PowerShell: Get File Version

Determine version of Exe or Dll

IT administrators need to compare the version information of the EXE or DLL files. This can be critical because, the version numbers indicate whether a software patch has been applied or not. However sifting through multiple version numbers of all EXE and DLL files can be laborious. Luckily, admins can determine the version information of the necessary files using the following PowerShell script.
 
To find out the version information of the necessary file, supply the path of the file and run the script. 

Script

<#
.SYNOPSIS
This script can be used to find the version of exe or dll.
.DESCRIPTION
This script can be used to find the version of exe or dll.
.EXAMPLE
C:\PS> C:\Script\Version.ps1 C:\Program Files (x86)\Mozilla Firefox\firefox.exe
Displays the current version of firefox available in the system.
#>
#Obtain the VersionInfo value to get the version of dll or exe.

param([String] $path)
Get-ChildItem $path | Select -Expand VersionInfo -ErrorAction SilentlyContinue

 




    • Related Articles

    • Create a ShortCut for an Exe File

      Creating a shortcut to an application on multiple end user desktops can be a laborious task. However, the process is pretty straightforward when using a PowerShell script. In the following script, provide the path of the EXE file and the exact path ...
    • Determine whether a machine is Laptop or not

      Administrators managing an enterprise with thousands of computers need to ascertain occasionally whether a particular computer is a laptop or a desktop before pushing out updates and applications. However, doing so manually is time-consuming. This is ...
    • Determine service status and start or stop them

      Get service status and start or stop a service based on feedback received. Script <# .SYNOPSIS This script can be used to start a service or stop a service. .DESCRIPTION This script can be used to start a service or stop a service. .EXAMPLE C:\PS> ...