Skip to content

Instantly share code, notes, and snippets.

@rglos
Last active July 9, 2018 20:17
Show Gist options
  • Save rglos/d0224ca3249e0769c3bdde2a3d363af8 to your computer and use it in GitHub Desktop.
Save rglos/d0224ca3249e0769c3bdde2a3d363af8 to your computer and use it in GitHub Desktop.
Get versions of file via PowerShell
$path = "C:\Path\To\Some.dll"
$versionInfo = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($path)
$assemblyName = [System.Reflection.AssemblyName]::GetAssemblyName($path)
Write-Host ("FileName: {0}" -f $versionInfo.FileName)
Write-Host ("AssemblyVersion: {0}" -f $assemblyName.Version)
Write-Host ("AssemblyFileVersion: {0}" -f $versionInfo.FileVersion)
Write-Host ("AssemblyInformationalVersion: {0}" -f $versionInfo.ProductVersion)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment