Last active
July 19, 2018 02:09
-
-
Save mattpodwysocki/9a9fa9e9b30e118ecebfae05c22e4f2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-Files($path = $pwd) { | |
foreach ($item in Get-ChildItem $path) { | |
if (Test-Path $item.FullName -PathType Container) { | |
Get-Files $item.FullName | |
} else { | |
$item | |
} | |
} | |
} | |
function Main($path = $pwd) { | |
$results = @() | |
$dllResults = @() | |
foreach ($item in Get-Files -path $path) { | |
$props = @{ | |
Item = $item.FullName | |
Hash = (Get-FileHash -Path $item.FullName).Hash | |
Version = $item.VersionInfo.FileVersion | |
} | |
$extn = [IO.Path]::GetExtension($item.FullName) | |
if ($extn -eq '.dll') { | |
$dllResults += New-Object psobject -Property $props | |
} | |
$results += New-Object psobject -Property $props | |
} | |
$results | Export-Csv 'Results.csv' -NoTypeInformation | |
$dllResults | Export-Csv 'ResultsDll.csv' -NoTypeInformation | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment