Posted By

michanne on 12/13/10


Tagged

file system PowerShell


Versions (?)

Get File Version Information for dlls


 / Published in: Windows PowerShell
 

  1. $a = $args\3.length
  2.  
  3. if ($a -eq 0) {Write-warning "You must supply a folder name."; break}
  4. else {$strFolder = $args\3[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 {$_\3.CompanyName -eq "Microsoft Corporation"})
  14.  
  15. cls
  16.  
  17. $d | format-table @{Label="DLL File";Expression={$_\3.FileName}},`
  18. @{Label="Company Name";Expression={($_\3.CompanyName)}},`
  19. @{Label="Version Number";Expression={$_\3.FileVersion}},`
  20. @{Label="File Size";Expression={"{0:N0}" -f (get-item $_\3.FileName).Length}} `
  21. -auto

Report this snippet  

You need to login to post a comment.