Kae Travis

Get Filenames and Versions in Folders and Subfolders

Posted on by in PowerShell

This is just a quick one-liner that I use to get filenames and versions in folders and subfolders.  I tend to use it every now and then to compare two folder structures on different machines, and then I can use a text comparison tool (such as www.diffnow.com) to compare the output:

You should first open a Powershell shell and CD to the root folder.  Then paste the following line and run it.  The output will go to c:\temp\filevers.txt.

get-childitem * -include *.* | foreach-object { "{0}`t{1}" -f $_.FullName, [System.Diagnostics.FileVersionInfo]::GetVersionInfo($_).FileVersion } | out-file c:\temp\filevers.txt

Yes, I’m sure there are free tools to accomplish this.  But this is just another option.

Get Filenames and Versions in Folders and Subfolders
Get Filenames and Versions in Folders and Subfolders

Leave a Reply