Get file version in PowerShell
Get file version in PowerShell
Get file version in PowerShell
Re: Get file version in PowerShell
Since PowerShell can call [.NET](https://en.wikipedia.org/wiki/.NET_Framework) classes, you could do the following:
```
[System.Diagnostics.FileVersionInfo]::GetVersionInfo("somefilepath").FileVersion
```
Or as [noted here](https://web.archive.org/web/20081004113553/https://kamhungsoh.com/blog/2008/01/powershell-file-version-information.html) on a list of files:
```
get-childitem * -include *.dll,*.exe | foreach-object { "{0}`t{1}" -f $_.Name, [System.Diagnostics.FileVersionInfo]::GetVersionInfo($_).FileVersion }
```
Or even nicer as a script: [https://jtruher3.wordpress.com/2006/05/14/powershell-and-file-version-information/](https://jtruher3.wordpress.com/2006/05/14/powershell-and-file-version-information/)
```
[System.Diagnostics.FileVersionInfo]::GetVersionInfo("somefilepath").FileVersion
```
Or as [noted here](https://web.archive.org/web/20081004113553/https://kamhungsoh.com/blog/2008/01/powershell-file-version-information.html) on a list of files:
```
get-childitem * -include *.dll,*.exe | foreach-object { "{0}`t{1}" -f $_.Name, [System.Diagnostics.FileVersionInfo]::GetVersionInfo($_).FileVersion }
```
Or even nicer as a script: [https://jtruher3.wordpress.com/2006/05/14/powershell-and-file-version-information/](https://jtruher3.wordpress.com/2006/05/14/powershell-and-file-version-information/)