Passing argumets to -rename fn in PowerShell

Any questions? Need some help?
Post Reply
stephen147
Donor
Posts: 131
Joined: 01 Sep 2015, 22:40

Passing argumets to -rename fn in PowerShell

Post by stephen147 »

:!: Tried to pass the F variable to the argument of the rename fn but no luck. Anyone get this to work?

Reason for this is I want more than one rename action so just having the one variable to change would be handy.

MY GO AT IT:

Code: Select all

$F = ('--file-filter "f.video || ext == /nfo/"' | Out-String)
$movieFolderPath = "Z:\Movies & TV\_Newly DL'd"
filebot -rename -r "$movieFolderPath" -non-strict --format "{n} - {y}" "$F" --db TheMovieDB --action test --log info
stephen147
Donor
Posts: 131
Joined: 01 Sep 2015, 22:40

Re: Passing argumets to -rename fn in PowerShell

Post by stephen147 »

Got it to work:

Code: Select all

$filterFiles = ('"f.video || ext == /nfo/ || ext == /srt/"')
$movieFolderPath = """Z:\Movies & TV\_Newly DL'd\_To Process"""
filebot -rename -r $movieFolderPath -non-strict --format "{n} - {y}" --db TheMovieDB --file-filter $filterFiles
Cannot get the variable to contain the switch

Code: Select all

--file-filter
but I can live with this.

This doesn't work:

Code: Select all

$filterFiles = ('--file-filter "f.video || ext == /nfo/ || ext == /srt/"')
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Passing argumets to -rename fn in PowerShell

Post by rednoah »

You can use the @file syntax for reading command-line arguments from external text files.

e.g.

Code: Select all

filebot @C:/rename.args @C:/format.args @C:/filter.args @C:/input-folders.args
:idea: Please read the FAQ and How to Request Help.
stephen147
Donor
Posts: 131
Joined: 01 Sep 2015, 22:40

Re: Passing argumets to -rename fn in PowerShell

Post by stephen147 »

rednoah wrote: 11 May 2019, 04:10 You can use the @file syntax for reading command-line arguments from external text files.

e.g.

Code: Select all

filebot @C:/rename.args @C:/format.args @C:/filter.args @C:/input-folders.args
Thanks. :mrgreen:
Post Reply