A rough and ready script to dump a directory's file listing including file and product versions for any executables and DLLs.
$OutputFile = 'c:\temp\Output.csv'
Set-Content -Path $OutputFile -Value "path,created,modified,fileVersion,productVersion"
$Files = Get-ChildItem -File .\* -Include *.* -Recurse
foreach ($File in $Files)
{
$ThisFile = (Get-Item $file)
$Name = $ThisFile.FullName;
$Created = $ThisFile.CreationTime
$Modified = $ThisFile.LastWriteTime
if ($ThisFile.Extension -eq '.dll' -or $ThisFile.Extension -eq '.exe')
{
$FileVer = $ThisFile.VersionInfo.FileVersion
$ProdVer = $ThisFile.VersionInfo.ProductVersion
}
else
{
$FileVer = ""
$ProdVer = ""
}
Add-Content -Path $OutputFile -Value "$Name,$Created,$Modified,$FileVer,$ProdVer"
}