Skip to content

Instantly share code, notes, and snippets.

@mattpodwysocki mattpodwysocki/Stamp.ps1
Last active Jul 19, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.