Get File Version Information for dlls


/ Published in: Windows PowerShell
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $a = $args.length
  2.  
  3. if ($a -eq 0) {Write-warning "You must supply a folder name."; break}
  4. else {$strFolder = $args[0] + "\*.dll"}
  5.  
  6. $b = @()
  7.  
  8. $c = get-childitem $strFolder
  9.  
  10. foreach ($i in $c)
  11. {$b += [system.diagnostics.fileversioninfo]::getversioninfo($i.fullname)}
  12.  
  13. $d = ($b | where-object {$_.CompanyName -eq "Microsoft Corporation"})
  14.  
  15. cls
  16.  
  17. $d | format-table @{Label="DLL File";Expression={$_.FileName}},`
  18. @{Label="Company Name";Expression={($_.CompanyName)}},`
  19. @{Label="Version Number";Expression={$_.FileVersion}},`
  20. @{Label="File Size";Expression={"{0:N0}" -f (get-item $_.FileName).Length}} `
  21. -auto

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.