Created
December 1, 2019 21:05
-
-
Save mattiasghodsian/a83cc7a06448f742cfedfb6dfaa0299b to your computer and use it in GitHub Desktop.
Renames TV files
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
Write-Host "################################ `n### TV File renamer by https://github.com/mattiasghodsian ### `n################################`n" -ForegroundColor Red | |
$series = Read-Host -Prompt 'Enter Series name (no end space)' | |
Write-Host "Set $series" -ForegroundColor Red -BackgroundColor Yellow | |
$season = Read-Host -Prompt 'Enter Season (example 01)' | |
Write-Host "Set $season" -ForegroundColor Red -BackgroundColor Yellow | |
Write-Host "Processing" | |
$path = Get-Location | |
$int = 1 | |
Get-ChildItem -Path $path -Recurse -Exclude *.ps1,*.zip -Filter "*" -file | %{ | |
$extension = $_.Extension | |
$newInt = "{0:D2}" -f $int | |
$curName = $_.Name | |
$newName = "$series S$season E$newInt$extension" | |
Rename-item -literalpath $_.PSPath -NewName $newName | |
Write-Host "$newName" -ForegroundColor Green | |
$int++ | |
} | |
PAUSE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment