Created
February 27, 2024 11:40
-
-
Save SanSan-/2570c75b6acbd7172d550abc30e50e85 to your computer and use it in GitHub Desktop.
Walk in current dir and convert all chapters to cbz
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
$current = Get-Location | |
$vols = Get-ChildItem -Path $current.Path -Directory | |
foreach ($vol in $vols) | |
{ | |
$chapters = Get-ChildItem -Path $vol.Name -Directory | |
foreach ($chapter in $chapters) | |
{ | |
$name = $chapter.Name | |
$fullName = $chapter.FullName | |
$zipName = "$name.zip" | |
$leadZerosName = '{0:d3}' -f [int]$name | |
$cbzName = "Ch.$leadZerosName.cbz" | |
Compress-Archive -Path $fullName -DestinationPath $zipName | |
Write-Output "Zip $fullName complete!" | |
Rename-Item -Path $zipName -NewName $cbzName | |
Write-Output "Rename to $cbzName complete!" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment