When you encounter an unfamiliar .dll on your system (or want to confirm exactly which version of a library is installed), PowerShell can pull the embedded metadata out of the file without any third-party tools. The information is the same as what Windows shows in the Details tab when you right-click a file and open Properties.
The Script
Save this as Get-DllInfo.ps1:
param([Parameter(Mandatory)][string]$Path)
function Get-DllInfo {
param(
[Parameter(Mandatory)][string]$DllPath
)
$fileInfo = Get-Item $DllPath
$versionInfo = $fileInfo.VersionInfo
$dllProperties = [PSCustomObject]@{
"File Description" = $versionInfo.FileDescription
"Type" = $versionInfo.FileType
"File Version" = $versionInfo.FileVersion
"Product Name" = $versionInfo.ProductName
"Product Version" = $versionInfo.ProductVersion
"Copyright" = $versionInfo.LegalCopyright
"Size" = $fileInfo.Length
"Date Modified" = $fileInfo.LastWriteTime
"Language" = $versionInfo.Language
"Original Filename" = $versionInfo.OriginalFilename
}
$dllProperties | Format-List
}
Get-DllInfo -DllPath $Path
Run it by passing a path to any DLL:
.\Get-DllInfo.ps1 -Path "C:\Windows\System32\ntdll.dll"
Output:
File Description : NT Layer DLL
Type : Dll
File Version : 10.0.26100.3775 (WinBuild.160101.0800)
Product Name : Microsoft® Windows® Operating System
Product Version : 10.0.26100.3775
Copyright : © Microsoft Corporation. All rights reserved.
Size : 2203136
Date Modified : 4/11/2025 6:47:56 AM
Language : English (United States)
Original Filename : ntdll.dll
How It Works
Get-Item and .VersionInfo
Get-Item returns a System.IO.FileInfo object for the path. On Windows, .dll and .exe files embed a VERSIONINFO resource block that the OS uses to display file properties in Explorer. PowerShell surfaces this through the .VersionInfo property (System.Diagnostics.FileVersionInfo object).
The properties used in the script:
| Property | Source | Description |
|---|---|---|
FileDescription |
VersionInfo |
Human-readable description of the file |
FileType |
VersionInfo |
Dll, App, Driver, etc. |
FileVersion |
VersionInfo |
Version string embedded at build time |
ProductName |
VersionInfo |
Name of the product this file belongs to |
ProductVersion |
VersionInfo |
Version of the overall product |
LegalCopyright |
VersionInfo |
Copyright notice |
Length |
FileInfo |
File size in bytes |
LastWriteTime |
FileInfo |
Last modified timestamp |
Language |
VersionInfo |
Locale the version resource was compiled for |
OriginalFilename |
VersionInfo |
The filename the DLL was compiled as. Useful for detecting renamed files |
FileVersion is a free-form string: the VERSIONINFO spec lets the developer put anything there. Microsoft Windows DLLs append the internal build lab name in parentheses, so you get strings like:
10.0.26100.3775 (WinBuild.160101.0800)
The numeric part (10.0.26100.3775) is the actual version. The part in parentheses (WinBuild.160101.0800) is the build lab identifier Microsoft uses internally to trace which build pipeline produced the binary. Third-party DLLs typically omit this and show just the version number.
If you need to parse the version numerically, use FileVersionInfo’s structured fields instead: FileMajorPart, FileMinorPart, FileBuildPart, and FilePrivatePart.
[PSCustomObject] and Format-List
Wrapping the properties in a [PSCustomObject] keeps them in insertion order and lets Format-List print each key-value pair on its own line.
One-Liner Alternative
If you just want a quick look without a script file:
(Get-Item "C:\Windows\System32\ntdll.dll").VersionInfo | Format-List
This dumps everything VersionInfo exposes (more fields than the script above).
Checking Multiple DLLs
To inspect every DLL in a directory:
Get-ChildItem "C:\Windows\System32\*.dll" | ForEach-Object {
$vi = $_.VersionInfo
[PSCustomObject]@{
Name = $_.Name
Version = $vi.FileVersion
Description = $vi.FileDescription
}
} | Format-Table Name, Version, @{Label="Description"; Expression={$_.Description}; Width=40}
⚠️ Format-Table drops columns from the right when the terminal isn’t wide enough. Without a fixed Width on Description you may only see Name and Version. The calculated property above caps it at 40 characters to prevent that.
If you want to sort and filter through GUI, use Out-GridView:
Get-ChildItem "C:\Windows\System32\*.dll" | ForEach-Object {
$vi = $_.VersionInfo
[PSCustomObject]@{
Name = $_.Name
"File Version" = $vi.FileVersion
"Product Version" = $vi.ProductVersion
Description = $vi.FileDescription
"Product Name" = $vi.ProductName
Copyright = $vi.LegalCopyright
Language = $vi.Language
Size = $_.Length
"Date Modified" = $_.LastWriteTime
}
} | Out-GridView