You can check version information for a
Dynamic-link
Library (DLL) file, i.e., a file with a .dll
filename extension, or a
executable file, i.e., a .exe file, from a command-line interface (CLI) on
a Microsoft Windows system by using the Get-Item
cmdlet. E.g.:
PS C:\> (Get-Item C:\Windows\explorer.exe).VersionInfo
ProductVersion FileVersion FileName
-------------- ----------- --------
10.0.15063.0 10.0.15063.0 ... C:\Windows\explorer.exe
PS C:\>
If you can't see all of the information, i.e., if you see three
dots indicating that not all of the information is displayed, you can
append | format-list
to the command to have the output displayed
in list format.
PS C:\> (Get-Item C:\Windows\explorer.exe).VersionInfo | format-list OriginalFilename : EXPLORER.EXE.MUI FileDescription : Windows Explorer ProductName : Microsoft® Windows® Operating System Comments : CompanyName : Microsoft Corporation FileName : C:\Windows\explorer.exe FileVersion : 10.0.15063.0 (WinBuild.160101.0800) ProductVersion : 10.0.15063.0 IsDebug : False IsPatched : False IsPreRelease : False IsPrivateBuild : False IsSpecialBuild : False Language : English (United States) LegalCopyright : © Microsoft Corporation. All rights reserved. LegalTrademarks : PrivateBuild : SpecialBuild : FileVersionRaw : 10.0.15063.608 ProductVersionRaw : 10.0.15063.608 PS C:\>
If you don't see any ProductVersion or FileVersion information, using
format-list
may reveal some useful information, such as
FileVersionRaw and ProductVersionRaw. E.g.:
PS C:\> (Get-Item "C:\program files (x86)\Graphics\Comic Life 3\ComicLife3.app\Contents\Windows\comiclife3.exe").VersionInfo ProductVersion FileVersion FileName -------------- ----------- -------- C:\program files (x86)\Graphics\Comic Life 3\ComicLife3.app\Contents\Windows\comic... PS C:\> (Get-Item "C:\program files (x86)\Graphics\Comic Life 3\ComicLife3.app\Contents\Windows\comiclife3.exe").VersionInfo | format-list OriginalFilename : FileDescription : ProductName : Comments : CompanyName : FileName : C:\program files (x86)\Graphics\Comic Life 3\ComicLife3.app\Contents\Windows\comiclife3.exe FileVersion : ProductVersion : IsDebug : False IsPatched : False IsPreRelease : False IsPrivateBuild : False IsSpecialBuild : False Language : English (United States) LegalCopyright : LegalTrademarks : PrivateBuild : SpecialBuild : FileVersionRaw : 3.5.6.0 ProductVersionRaw : 3.5.6.0 PS C:\>
If there are spaces in the directory path or file name, you need to enclose the directory path and file name in double quotes as in the example above.
You can also retrieve just specific values, e.g., ProductVersion,
CompanyName, LegalCopyright, etc., by putting a dot and then the value's
name after VersionInfo
. E.g.:
PS C:\> (Get-Item C:\Windows\explorer.exe).VersionInfo.ProductVersion 10.0.15063.0 PS C:\> (Get-Item C:\Windows\explorer.exe).VersionInfo.CompanyName Microsoft Corporation PS C:\> (Get-Item C:\Windows\explorer.exe).VersionInfo.LegalCopyright © Microsoft Corporation. All rights reserved. PS C:\>
You can use the cmdlet with .dll as well as .exe files.
PS C:\> (Get-Item "C:\program files (x86)\Graphics\Comic Life 3\ComicLife3.app\Contents\Windows\libegl.dll").VersionInfo | format-list OriginalFilename : libEGL.dll FileDescription : ANGLE libEGL Dynamic Link Library ProductName : ANGLE libEGL Dynamic Link Library Comments : Build Date: 2016-04-08 19:03:44 +0000 CompanyName : FileName : C:\program files (x86)\Graphics\Comic Life 3\ComicLife3.app\Contents\Windows\libegl.dll FileVersion : 2.1.0.53a36004bf36 ProductVersion : 2.1.0.53a36004bf36 IsDebug : False IsPatched : False IsPreRelease : False IsPrivateBuild : False IsSpecialBuild : False Language : English (United States) LegalCopyright : Copyright (C) 2015 Google Inc. LegalTrademarks : PrivateBuild : 2.1.0.53a36004bf36 SpecialBuild : FileVersionRaw : 2.1.0.0 ProductVersionRaw : 2.1.0.0 PS C:\>
If you wish to check values for multiple files at once, you can
include wildcard characters, such as "*", in the file name and
can also use a select
statement to return specific values. E.g.:
PS C:\program files (x86)\graphics\Comic Life 3\ComicLife3.app\contents\windows> (Get-Item *.dll).VersionInfo | select Filename, ProductVersionRaw FileName ProductVersionRaw -------- ----------------- C:\program files (x86)\graphics\Comic Life 3\ComicLife3.app\contents\windows\AppKit.1.0.dll 0.0.0.0 C:\program files (x86)\graphics\Comic Life 3\ComicLife3.app\contents\windows\CommonCrypto.1.0.dll 0.0.0.0 C:\program files (x86)\graphics\Comic Life 3\ComicLife3.app\contents\windows\d3dcompiler_47.dll 6.3.9600.16384 C:\program files (x86)\graphics\Comic Life 3\ComicLife3.app\contents\windows\Foundation.1.0.dll 0.0.0.0 C:\program files (x86)\graphics\Comic Life 3\ComicLife3.app\contents\windows\hunspell.1.3.1.dll 0.0.0.0 C:\program files (x86)\graphics\Comic Life 3\ComicLife3.app\contents\windows\libEGL.dll 2.1.0.0 C:\program files (x86)\graphics\Comic Life 3\ComicLife3.app\contents\windows\libGLESv2.dll 2.1.0.0 PS C:\program files (x86)\graphics\Comic Life 3\ComicLife3.app\contents\windows>