Skip to content

Instantly share code, notes, and snippets.

@Fabaderheld
Last active July 5, 2023 09:41
Show Gist options
  • Save Fabaderheld/70abf92f8d35c2c6cfc324833bc1f1b4 to your computer and use it in GitHub Desktop.
Save Fabaderheld/70abf92f8d35c2c6cfc324833bc1f1b4 to your computer and use it in GitHub Desktop.
replace Volume year whit volume number

function Rename-Volume { $Comics = Get-ChildItem

foreach ($Comic in $Comics) {
    $Volume = (($Comic.PSParentPath -split "/")[-1] -split " ")[1]

    Move-Item -Path $($Comic.FullName) -Destination $($($Comic.Fullname) -replace "Vol\.\d+", "Volume $Volume")
    $Comic | Where-Object { $_.Name -eq "series.json" -or $_.Name -eq "folder.jpg" -or $_.Name -eq "cover.jpg" } | Remove-Item
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment