Skip to content

Instantly share code, notes, and snippets.

@icirellik
Created December 27, 2019 04:34
Show Gist options
  • Save icirellik/5e6db3dfc5b58a7fa6c4b3a64c8dc687 to your computer and use it in GitHub Desktop.
Save icirellik/5e6db3dfc5b58a7fa6c4b3a64c8dc687 to your computer and use it in GitHub Desktop.
Windows Powershell Zip + Hash Utilities
# Recusively Unzip 7-zip files in place
$7zipPath = "$env:ProgramFiles\7-Zip\7z.exe"
if (-not (Test-Path -Path $7zipPath -PathType Leaf)) {
throw "7 zip file '$7zipPath' not found"
}
Set-Alias 7zip $7zipPath
Get-ChildItem -Recurse *.z | %{ 7zip e $_.FullName "-o$($_.Directory)"}
# Recursively hash all files ands save the output to a file.
gci -File -rec | Get-FileHash > C:\file-hashes.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment