Created
March 18, 2019 19:09
-
-
Save clive2000/a5e72488ab92e7a8a1d48cd5d8e925eb to your computer and use it in GitHub Desktop.
Powershell script to create 7z archive for each subfolder
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
# Loop thorugh folder | |
$7z = 'C:\Program Files\7-Zip\7z.exe' | |
Get-ChildItem $PWD -Directory | ForEach-Object { | |
& $7z a -t7z (-join($_.Name,".7z")) $_.FullName | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment