Skip to content

Instantly share code, notes, and snippets.

@drasive
Created February 16, 2017 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drasive/2064cc77bdb2c806d4fd45f385cb0686 to your computer and use it in GitHub Desktop.
Save drasive/2064cc77bdb2c806d4fd45f385cb0686 to your computer and use it in GitHub Desktop.
Bulk .NET Assembly Version Checker
$directory = "TO_BE_SET"
$fileFilter = "TO_BE_SET"
$tableOrder = `
@{ `
Expression = {[System.Diagnostics.FileVersionInfo]::GetVersionInfo($_.FullName).ProductVersion.ToString()}; `
Descending = $False}, `
@{ `
Expression = {$_.Name}; `
Descending = $False}
$tableColumns = `
@{ `
Expression = {$_.Name}; `
Label = "Assembly"; `
width = 64}, `
@{ `
Label = "Product Version"; `
Expression = {[System.Diagnostics.FileVersionInfo]::GetVersionInfo($_.FullName).ProductVersion.ToString()}; `
width = 15}, `
@{ `
Label = "File Version"; `
Expression = {[System.Diagnostics.FileVersionInfo]::GetVersionInfo($_.FullName).FileVersion.ToString()}; `
width = 15}
Write-Host "Directory: $($directory)"
Write-Host "File filter: $($fileFilter)"
Get-ChildItem $directory -Filter $fileFilter `
| Sort-Object -Property $tableOrder `
| Format-Table $tableColumns
Write-Host "Press any key to continue ..."
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment