Using Powershell.

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
corespeed
Posts: 2
Joined: 06 Oct 2015, 20:49

Using Powershell.

Post 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
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Using Powershell.

Post 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.
:idea: Please read the FAQ and How to Request Help.
corespeed
Posts: 2
Joined: 06 Oct 2015, 20:49

Re: Using Powershell.

Post 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
Post Reply