Created
May 7, 2020 18:45
-
-
Save BadgerCode/aa39266e61accaceb2a801d5d05e0565 to your computer and use it in GitHub Desktop.
Uses 7-zip CLI to compress files individually using BZIP2 on Windows
This file contains hidden or 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
$path = "C:\Users\mike-\Downloads\stuff" | |
$7zipPath = "C:\Program Files\7-Zip\7z.exe" | |
$files = dir $path -Recurse -Include $mask | where { | |
($_.Length / 1KB) -gt 100 | |
} | |
ForEach ($file in $files) | |
{ | |
Write-Host "$($file.FullName).bz2" | |
& $7zipPath a -tbzip2 "$($file.FullName).bz2" $file.FullName | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment