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