EliziumNet / RexFs

Regular expression based Bulk File/Directory renamer
MIT License
4 stars 2 forks source link

Rename-Many: Add ability to change the extension #6

Open plastikfan opened 3 years ago

plastikfan commented 3 years ago

Use function [System.IO.Path]::ChangeExtension. Introduce a new 'Ext' parameter that specifies the new extension. What's better is to allow the user to pass in a 2 element array:

-Ext 'mp3', 'flac'

and in this example, all files with 'mp3' are changed to 'flac'. We got 2 situations here:

1) allow -Ext to be specified, without a Pattern or Cut. In this situation, the user is performing a straight forward extension change operation 2) allow -Ext to be specified along side other Pattern/Cut, which means the extension change is a supplementary operation in addition to the main rename operation.

Problem with this is this would require a new parameter set, lets call this 'ChangeExtension' which would have -Ext as a mandatory parameter, but allowing it to be used along side Pattern/Cut would mean that -Ext would not be a unique parameter to 'ChangeExtension'. Perhaps this is ok. Its better than having 2 extension parameters for different parameter sets.