Thursday, 9 December 2021

Using powershell to look for files and versions

 Yesterday I had a runtime problem which required me to find a file with a particular version because it wasn't clear where or how this error was being produced. I used powershell to find files of name x and list their versions.

Get-Childitem C:\Projects -Include system.linq.dll -Recurse | Foreach-Object { "{0}`t{1}" -f $_.FullName   [System.Diagnostics.FileVersionInfo]::GetVersionInfo($_).FileVersion }