Skip to content

Instantly share code, notes, and snippets.

@tiernano
Created September 28, 2012 07:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tiernano/3798509 to your computer and use it in GitHub Desktop.
Save tiernano/3798509 to your computer and use it in GitHub Desktop.
Convert Files to AppleTV2 format using PowerShell and HandBrake
$files = gci "path to your file location"
$handbrake = "C:\Program Files\HandBrake\HandBrakeCLI.exe"
foreach($file in $files) {
$newFileName = "path to where you want the files to be set to..." + [System.IO.Path]::GetFileNameWithoutExtension($file) + ".m4v"
& $handbrake -i $file.FullName -o $newFileName --preset "AppleTV 2"
if ($LastExitCode -ne 0)
{
Write-Warning "Error converting $($file.FullName)"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment