Page 1 of 1

Using Powershell.

Posted: 06 Oct 2015, 21:10
by corespeed
Completely new to Filebot and not do not quite have my head around running Filebot :oops: from the CLI automated under its own power. Can I get some help on basic syntax to just accomplish the following via CLI?

:?: Want to copy from 'Source/Subdirectories' to 'Destination/Subdirectories' with file name convention "{n}/{'Season '+s}/{n} - {s00e00} - {t}"


Here is what I threw together for Powershell which has worked properly.

Code: Select all

function Start-Filebot{
$source = "D:\Complete\Unsorted\tv\"
$destination = "D:\Complete\TV\"

$db = "TheTVDB"
$format = "{n}/{'Season '+s}/{n} - {s00e00} - {t}"

$conflictpref = "override"
$mode = "-non-strict"
$opt = "-rename"

$dir = $('Get-Item '  + $($source + "* ") + '| select -expandproperty name')
$dir = $dir | Invoke-Expression

$dir | %{
$d = 'D:\complete\unsorted\tv\' + $_
$cmd = {$("Filebot " + $opt + ' "' + $d + '" ' + '--output' + " '" +$destination + "' " + "--format" + ' "' + $format + '" ' + $mode + " --db " + $db + ' --conflict ' + $conflictpref)}
$cmd = $cmd | Invoke-Expression
}}

Start-Filebot

Re: Using Powershell.

Posted: 07 Oct 2015, 08:35
by rednoah

Code: Select all

$ filebot -help

Code: Select all

-r                                     : Resolve folders recursively
I guess this is what you want... please keep your code examples short and concise.

Re: Using Powershell.

Posted: 07 Oct 2015, 23:11
by corespeed
I saw that I just am not putting the pull command together, missing something in the syntax.

'That one little thing you miss' :p