en-GB/Elizium.RexFs-help.xml
<?xml version="1.0" encoding="utf-8"?>
<helpItems schema="maml" xmlns="http://msh"> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Add-Appendage</command:name> <command:verb>Add</command:verb> <command:noun>Appendage</command:noun> <maml:description> <maml:para>The core appendage action function principally used by Rename-Many. Adds either a prefix or suffix to the Value.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Returns a new string that reflects the addition of an appendage, which can be Prepend or Append. The appendage itself can be static text, or can act like a formatter supporting Copy named group reference s, if present. The user can decide to reference the whole Copy match with ${_c}, or if it contains named captures, these can be referenced inside the appendage as ${<group-name-ref>}</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Add-Appendage</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Value</maml:name> <maml:description> <maml:para>The source value against which regular expressions are applied.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Appendage</maml:name> <maml:description> <maml:para>String to either prepend or append to Value. Supports named captures inside Copy regex parameter.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>Type</maml:name> <maml:description> <maml:para>Denotes the appendage type, can be 'Prepend' or 'Append'.</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Prepend</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Append</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="3" aliases="none"> <maml:name>Copy</maml:name> <maml:description> <maml:para>Regular expression string applied to $Value, indicating a portion which should be copied and inserted into the Appendage. The match defined by $Copy is stored in special variable ${_c} and can be referenced as such from $Appendage.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="4" aliases="none"> <maml:name>CopyOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l</maml:para> <maml:para>* f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Diagnose</maml:name> <maml:description> <maml:para>switch parameter that indicates the command should be run in WhatIf mode. When enabled it presents additional information that assists the user in correcting the un-expected results caused by an incorrect/un-intended regular expression. The current diagnosis will show the contents of named capture groups that they may have specified. When an item is not renamed (usually because of an incorrect regular expression), the user can use the diagnostics along side the 'Not Renamed' reason to track down errors.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Appendage</maml:name> <maml:description> <maml:para>String to either prepend or append to Value. Supports named captures inside Copy regex parameter.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="3" aliases="none"> <maml:name>Copy</maml:name> <maml:description> <maml:para>Regular expression string applied to $Value, indicating a portion which should be copied and inserted into the Appendage. The match defined by $Copy is stored in special variable ${_c} and can be referenced as such from $Appendage.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="4" aliases="none"> <maml:name>CopyOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l</maml:para> <maml:para>* f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Diagnose</maml:name> <maml:description> <maml:para>switch parameter that indicates the command should be run in WhatIf mode. When enabled it presents additional information that assists the user in correcting the un-expected results caused by an incorrect/un-intended regular expression. The current diagnosis will show the contents of named capture groups that they may have specified. When an item is not renamed (usually because of an incorrect regular expression), the user can use the diagnostics along side the 'Not Renamed' reason to track down errors.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>Type</maml:name> <maml:description> <maml:para>Denotes the appendage type, can be 'Prepend' or 'Append'.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Value</maml:name> <maml:description> <maml:para>The source value against which regular expressions are applied.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>PS C:\> {{ Add example code here }}</dev:code> <dev:remarks> <maml:para>{{ Add example description here }}</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Elizium.RexFs</maml:linkText> <maml:uri>https://github.com/EliziumNet/RexFs</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Format-Escape</command:name> <command:verb>Format</command:verb> <command:noun>Escape</command:noun> <maml:description> <maml:para>Escapes the regular expression specified. This is just a wrapper around the .net regex::escape method, but gives the user a much easier way to invoke it from the command line.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Various functions in Loopz have parameters that accept a regular expression. This function gives the user an easy way to escape the regex, without them having to do this manually themselves which could be tricky to get right depending on their requirements. NB: an alternative to using the 'esc' function is to add a ~ to the start of the pattern. The tilde is not taken as part of the pattern and is stripped off. If a partial escape is required, then split the value into parts that require escaping and the other parts that don't.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Format-Escape</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Source</maml:name> <maml:description> <maml:para>The source string to escape.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Object</command:parameterValue> <dev:type> <maml:name>Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Source</maml:name> <maml:description> <maml:para>The source string to escape.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Object</command:parameterValue> <dev:type> <maml:name>Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>Rename-Many -Pattern $(esc('(123)'))</dev:code> <dev:remarks> <maml:para>Use the 'esc' alias with the Rename-Many command, escaping the regex characters in the Pattern definition.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------- EXAMPLE 2 (Use with Rename-Many command) -----------</maml:title> <dev:code>Rename-Many -Pattern '~(123)'</dev:code> <dev:remarks> <maml:para>Use a leading '~' in the pattern definition, to escape the whole value.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------- EXAMPLE 3 (Use with Rename-Many command) -----------</maml:title> <dev:code>Rename-Many -Pattern $(esc('(123)') + '(?<n>\d{3})')</dev:code> <dev:remarks> <maml:para>Partial escape defined by concatenating patterns individually escaped or not.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Elizium.RexFs</maml:linkText> <maml:uri>https://github.com/EliziumNet/RexFs</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Move-Match</command:name> <command:verb>Move</command:verb> <command:noun>Match</command:noun> <maml:description> <maml:para>The core move match action function principally used by Rename-Many. Moves a match according to the specified anchor(s).</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Returns a new string that reflects moving the specified $Pattern match to either the location designated by $Anchor/$AnchorOccurrence/$Relation or to the Start or End of the value indicated by the presence of the $Start/$End switch parameters.</maml:para> <maml:para>First Move-Match, removes the Pattern match from the source. This makes the With and Anchor match against the remainder ($patternRemoved) of the source. This way, there is no overlap between the Pattern match and With/Anchor and it also makes the functionality more understandable for the user. NB: $Pattern only tells you what to remove, but it's the $With, $Copy and $Paste that defines what to insert, with the $Anchor/$Start/$End defining where the replacement text should go. The user should not be using named capture groups in $Copy, or $Anchor, rather, they should be defined inside $Paste and referenced inside $Paste/$With.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Move-Match</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Value</maml:name> <maml:description> <maml:para>The source value against which regular expressions are applied.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Pattern</maml:name> <maml:description> <maml:para>Regular expression object that indicates which part of the $Value that either needs to be moved or replaced as part of overall rename operation. Those characters in $Value which match $Pattern, are removed.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Anchor</maml:name> <maml:description> <maml:para>Anchor is a regular expression string applied to $Value (after the $Pattern match has been removed). The $Pattern match that is removed is inserted at the position indicated by the anchor match in collaboration with the $Relation parameter.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AnchorOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l</maml:para> <maml:para>* f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Copy</maml:name> <maml:description> <maml:para>Regular expression string applied to $Value (after the $Pattern match has been removed), indicating a portion which should be copied and re-inserted (via the $Paste parameter; see $Paste or $With). Since this is a regular expression to be used in $Paste/$With, there is no value in the user specifying a static pattern, because that static string can just be defined in $Paste/$With. The value in the $Copy parameter comes when a generic pattern is defined eg \d{3} (is non static), specifies any 3 digits as opposed to say '123', which could be used directly in the $Paste/$With parameter without the need for $Copy. The match defined by $Copy is stored in special variable ${_c} and can be referenced as such from $Paste and $With.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CopyOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l * f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Diagnose</maml:name> <maml:description> <maml:para>switch parameter that indicates the command should be run in WhatIf mode. When enabled it presents additional information that assists the user in correcting the un-expected results caused by an incorrect/un-intended regular expression. The current diagnosis will show the contents of named capture groups that they may have specified. When an item is not renamed (usually because of an incorrect regular expression), the user can use the diagnostics along side the 'Not Renamed' reason to track down errors. When $Diagnose has been specified, $WhatIf does not need to be specified.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Drop</maml:name> <maml:description> <maml:para>A string parameter (only applicable to move operations, ie any of these Anchor/Star/End are present) that defines what text is used to replace the $Pattern match. So in this use-case, the user wants to move a particular token/pattern to another part of the name and at the same time drop a static string in the place where the $Pattern was removed from. The user can also reference named group captures defined inside Pattern or Copy. (Note that the whole Copy capture can be referenced with ${_c}.)</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Marker</maml:name> <maml:description> <maml:para>A character used to mark the place where the $Pattern was removed from. It should be a special character that is not easily typed on the keyboard by the user so as to not interfere wth $Anchor/$Copy matches which occur after $Pattern match is removed.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Char</command:parameterValue> <dev:type> <maml:name>Char</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PatternOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l</maml:para> <maml:para>* f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Relation</maml:name> <maml:description> <maml:para>Used in conjunction with the $Anchor parameter and can be set to either 'before' or 'after' (the default). Defines the relationship of the $Pattern match with the $Anchor match in the new name for $Value.</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">before</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">after</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>With</maml:name> <maml:description> <maml:para>This is a NON regular expression string. It would be more accurately described as a formatter. Defines what text is used as the replacement for the $Pattern match. $With can reference special variables:</maml:para> <maml:para>* $0: the pattern match</maml:para> <maml:para>* ${_a}: the anchor match</maml:para> <maml:para>* ${_c}: the copy match</maml:para> <maml:para></maml:para> <maml:para>When $Pattern contains named capture groups, these variables can also be referenced. Eg if the $Pattern is defined as '(?<day>\d{1,2})-(?<mon>\d{1,2})-(?<year>\d{4})', then the variables ${day}, ${mon} and ${year} also become available for use in $With. Typically, $With is static text which is used to replace the $Pattern match and is inserted according to the Anchor match, (or indeed $Start or $End).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Move-Match</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Value</maml:name> <maml:description> <maml:para>The source value against which regular expressions are applied.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Pattern</maml:name> <maml:description> <maml:para>Regular expression object that indicates which part of the $Value that either needs to be moved or replaced as part of overall rename operation. Those characters in $Value which match $Pattern, are removed.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Anchor</maml:name> <maml:description> <maml:para>Anchor is a regular expression string applied to $Value (after the $Pattern match has been removed). The $Pattern match that is removed is inserted at the position indicated by the anchor match in collaboration with the $Relation parameter.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AnchorOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l</maml:para> <maml:para>* f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Copy</maml:name> <maml:description> <maml:para>Regular expression string applied to $Value (after the $Pattern match has been removed), indicating a portion which should be copied and re-inserted (via the $Paste parameter; see $Paste or $With). Since this is a regular expression to be used in $Paste/$With, there is no value in the user specifying a static pattern, because that static string can just be defined in $Paste/$With. The value in the $Copy parameter comes when a generic pattern is defined eg \d{3} (is non static), specifies any 3 digits as opposed to say '123', which could be used directly in the $Paste/$With parameter without the need for $Copy. The match defined by $Copy is stored in special variable ${_c} and can be referenced as such from $Paste and $With.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CopyOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l * f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Diagnose</maml:name> <maml:description> <maml:para>switch parameter that indicates the command should be run in WhatIf mode. When enabled it presents additional information that assists the user in correcting the un-expected results caused by an incorrect/un-intended regular expression. The current diagnosis will show the contents of named capture groups that they may have specified. When an item is not renamed (usually because of an incorrect regular expression), the user can use the diagnostics along side the 'Not Renamed' reason to track down errors. When $Diagnose has been specified, $WhatIf does not need to be specified.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Drop</maml:name> <maml:description> <maml:para>A string parameter (only applicable to move operations, ie any of these Anchor/Star/End are present) that defines what text is used to replace the $Pattern match. So in this use-case, the user wants to move a particular token/pattern to another part of the name and at the same time drop a static string in the place where the $Pattern was removed from. The user can also reference named group captures defined inside Pattern or Copy. (Note that the whole Copy capture can be referenced with ${_c}.)</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>End</maml:name> <maml:description> <maml:para>Is another type of anchor used instead of $Anchor and specifies that the $Pattern match should be moved to the end of the new name.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Marker</maml:name> <maml:description> <maml:para>A character used to mark the place where the $Pattern was removed from. It should be a special character that is not easily typed on the keyboard by the user so as to not interfere wth $Anchor/$Copy matches which occur after $Pattern match is removed.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Char</command:parameterValue> <dev:type> <maml:name>Char</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PatternOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l</maml:para> <maml:para>* f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Relation</maml:name> <maml:description> <maml:para>Used in conjunction with the $Anchor parameter and can be set to either 'before' or 'after' (the default). Defines the relationship of the $Pattern match with the $Anchor match in the new name for $Value.</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">before</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">after</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>With</maml:name> <maml:description> <maml:para>This is a NON regular expression string. It would be more accurately described as a formatter. Defines what text is used as the replacement for the $Pattern match. $With can reference special variables:</maml:para> <maml:para>* $0: the pattern match</maml:para> <maml:para>* ${_a}: the anchor match</maml:para> <maml:para>* ${_c}: the copy match</maml:para> <maml:para></maml:para> <maml:para>When $Pattern contains named capture groups, these variables can also be referenced. Eg if the $Pattern is defined as '(?<day>\d{1,2})-(?<mon>\d{1,2})-(?<year>\d{4})', then the variables ${day}, ${mon} and ${year} also become available for use in $With. Typically, $With is static text which is used to replace the $Pattern match and is inserted according to the Anchor match, (or indeed $Start or $End).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Move-Match</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Value</maml:name> <maml:description> <maml:para>The source value against which regular expressions are applied.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Pattern</maml:name> <maml:description> <maml:para>Regular expression object that indicates which part of the $Value that either needs to be moved or replaced as part of overall rename operation. Those characters in $Value which match $Pattern, are removed.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Anchor</maml:name> <maml:description> <maml:para>Anchor is a regular expression string applied to $Value (after the $Pattern match has been removed). The $Pattern match that is removed is inserted at the position indicated by the anchor match in collaboration with the $Relation parameter.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AnchorOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l</maml:para> <maml:para>* f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Copy</maml:name> <maml:description> <maml:para>Regular expression string applied to $Value (after the $Pattern match has been removed), indicating a portion which should be copied and re-inserted (via the $Paste parameter; see $Paste or $With). Since this is a regular expression to be used in $Paste/$With, there is no value in the user specifying a static pattern, because that static string can just be defined in $Paste/$With. The value in the $Copy parameter comes when a generic pattern is defined eg \d{3} (is non static), specifies any 3 digits as opposed to say '123', which could be used directly in the $Paste/$With parameter without the need for $Copy. The match defined by $Copy is stored in special variable ${_c} and can be referenced as such from $Paste and $With.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CopyOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l * f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Diagnose</maml:name> <maml:description> <maml:para>switch parameter that indicates the command should be run in WhatIf mode. When enabled it presents additional information that assists the user in correcting the un-expected results caused by an incorrect/un-intended regular expression. The current diagnosis will show the contents of named capture groups that they may have specified. When an item is not renamed (usually because of an incorrect regular expression), the user can use the diagnostics along side the 'Not Renamed' reason to track down errors. When $Diagnose has been specified, $WhatIf does not need to be specified.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Drop</maml:name> <maml:description> <maml:para>A string parameter (only applicable to move operations, ie any of these Anchor/Star/End are present) that defines what text is used to replace the $Pattern match. So in this use-case, the user wants to move a particular token/pattern to another part of the name and at the same time drop a static string in the place where the $Pattern was removed from. The user can also reference named group captures defined inside Pattern or Copy. (Note that the whole Copy capture can be referenced with ${_c}.)</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Marker</maml:name> <maml:description> <maml:para>A character used to mark the place where the $Pattern was removed from. It should be a special character that is not easily typed on the keyboard by the user so as to not interfere wth $Anchor/$Copy matches which occur after $Pattern match is removed.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Char</command:parameterValue> <dev:type> <maml:name>Char</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PatternOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l</maml:para> <maml:para>* f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Relation</maml:name> <maml:description> <maml:para>Used in conjunction with the $Anchor parameter and can be set to either 'before' or 'after' (the default). Defines the relationship of the $Pattern match with the $Anchor match in the new name for $Value.</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">before</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">after</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Start</maml:name> <maml:description> <maml:para>Is another type of anchor used instead of $Anchor and specifies that the $Pattern match should be moved to the start of the new name.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>With</maml:name> <maml:description> <maml:para>This is a NON regular expression string. It would be more accurately described as a formatter. Defines what text is used as the replacement for the $Pattern match. $With can reference special variables:</maml:para> <maml:para>* $0: the pattern match</maml:para> <maml:para>* ${_a}: the anchor match</maml:para> <maml:para>* ${_c}: the copy match</maml:para> <maml:para></maml:para> <maml:para>When $Pattern contains named capture groups, these variables can also be referenced. Eg if the $Pattern is defined as '(?<day>\d{1,2})-(?<mon>\d{1,2})-(?<year>\d{4})', then the variables ${day}, ${mon} and ${year} also become available for use in $With. Typically, $With is static text which is used to replace the $Pattern match and is inserted according to the Anchor match, (or indeed $Start or $End).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Move-Match</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Value</maml:name> <maml:description> <maml:para>The source value against which regular expressions are applied.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Pattern</maml:name> <maml:description> <maml:para>Regular expression object that indicates which part of the $Value that either needs to be moved or replaced as part of overall rename operation. Those characters in $Value which match $Pattern, are removed.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Copy</maml:name> <maml:description> <maml:para>Regular expression string applied to $Value (after the $Pattern match has been removed), indicating a portion which should be copied and re-inserted (via the $Paste parameter; see $Paste or $With). Since this is a regular expression to be used in $Paste/$With, there is no value in the user specifying a static pattern, because that static string can just be defined in $Paste/$With. The value in the $Copy parameter comes when a generic pattern is defined eg \d{3} (is non static), specifies any 3 digits as opposed to say '123', which could be used directly in the $Paste/$With parameter without the need for $Copy. The match defined by $Copy is stored in special variable ${_c} and can be referenced as such from $Paste and $With.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CopyOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l * f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Diagnose</maml:name> <maml:description> <maml:para>switch parameter that indicates the command should be run in WhatIf mode. When enabled it presents additional information that assists the user in correcting the un-expected results caused by an incorrect/un-intended regular expression. The current diagnosis will show the contents of named capture groups that they may have specified. When an item is not renamed (usually because of an incorrect regular expression), the user can use the diagnostics along side the 'Not Renamed' reason to track down errors. When $Diagnose has been specified, $WhatIf does not need to be specified.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Drop</maml:name> <maml:description> <maml:para>A string parameter (only applicable to move operations, ie any of these Anchor/Star/End are present) that defines what text is used to replace the $Pattern match. So in this use-case, the user wants to move a particular token/pattern to another part of the name and at the same time drop a static string in the place where the $Pattern was removed from. The user can also reference named group captures defined inside Pattern or Copy. (Note that the whole Copy capture can be referenced with ${_c}.)</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>End</maml:name> <maml:description> <maml:para>Is another type of anchor used instead of $Anchor and specifies that the $Pattern match should be moved to the end of the new name.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Marker</maml:name> <maml:description> <maml:para>A character used to mark the place where the $Pattern was removed from. It should be a special character that is not easily typed on the keyboard by the user so as to not interfere wth $Anchor/$Copy matches which occur after $Pattern match is removed.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Char</command:parameterValue> <dev:type> <maml:name>Char</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PatternOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l</maml:para> <maml:para>* f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>With</maml:name> <maml:description> <maml:para>This is a NON regular expression string. It would be more accurately described as a formatter. Defines what text is used as the replacement for the $Pattern match. $With can reference special variables:</maml:para> <maml:para>* $0: the pattern match</maml:para> <maml:para>* ${_a}: the anchor match</maml:para> <maml:para>* ${_c}: the copy match</maml:para> <maml:para></maml:para> <maml:para>When $Pattern contains named capture groups, these variables can also be referenced. Eg if the $Pattern is defined as '(?<day>\d{1,2})-(?<mon>\d{1,2})-(?<year>\d{4})', then the variables ${day}, ${mon} and ${year} also become available for use in $With. Typically, $With is static text which is used to replace the $Pattern match and is inserted according to the Anchor match, (or indeed $Start or $End).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Move-Match</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Value</maml:name> <maml:description> <maml:para>The source value against which regular expressions are applied.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Pattern</maml:name> <maml:description> <maml:para>Regular expression object that indicates which part of the $Value that either needs to be moved or replaced as part of overall rename operation. Those characters in $Value which match $Pattern, are removed.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Copy</maml:name> <maml:description> <maml:para>Regular expression string applied to $Value (after the $Pattern match has been removed), indicating a portion which should be copied and re-inserted (via the $Paste parameter; see $Paste or $With). Since this is a regular expression to be used in $Paste/$With, there is no value in the user specifying a static pattern, because that static string can just be defined in $Paste/$With. The value in the $Copy parameter comes when a generic pattern is defined eg \d{3} (is non static), specifies any 3 digits as opposed to say '123', which could be used directly in the $Paste/$With parameter without the need for $Copy. The match defined by $Copy is stored in special variable ${_c} and can be referenced as such from $Paste and $With.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CopyOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l * f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Diagnose</maml:name> <maml:description> <maml:para>switch parameter that indicates the command should be run in WhatIf mode. When enabled it presents additional information that assists the user in correcting the un-expected results caused by an incorrect/un-intended regular expression. The current diagnosis will show the contents of named capture groups that they may have specified. When an item is not renamed (usually because of an incorrect regular expression), the user can use the diagnostics along side the 'Not Renamed' reason to track down errors. When $Diagnose has been specified, $WhatIf does not need to be specified.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Drop</maml:name> <maml:description> <maml:para>A string parameter (only applicable to move operations, ie any of these Anchor/Star/End are present) that defines what text is used to replace the $Pattern match. So in this use-case, the user wants to move a particular token/pattern to another part of the name and at the same time drop a static string in the place where the $Pattern was removed from. The user can also reference named group captures defined inside Pattern or Copy. (Note that the whole Copy capture can be referenced with ${_c}.)</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Marker</maml:name> <maml:description> <maml:para>A character used to mark the place where the $Pattern was removed from. It should be a special character that is not easily typed on the keyboard by the user so as to not interfere wth $Anchor/$Copy matches which occur after $Pattern match is removed.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Char</command:parameterValue> <dev:type> <maml:name>Char</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PatternOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l</maml:para> <maml:para>* f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Start</maml:name> <maml:description> <maml:para>Is another type of anchor used instead of $Anchor and specifies that the $Pattern match should be moved to the start of the new name.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>With</maml:name> <maml:description> <maml:para>This is a NON regular expression string. It would be more accurately described as a formatter. Defines what text is used as the replacement for the $Pattern match. $With can reference special variables:</maml:para> <maml:para>* $0: the pattern match</maml:para> <maml:para>* ${_a}: the anchor match</maml:para> <maml:para>* ${_c}: the copy match</maml:para> <maml:para></maml:para> <maml:para>When $Pattern contains named capture groups, these variables can also be referenced. Eg if the $Pattern is defined as '(?<day>\d{1,2})-(?<mon>\d{1,2})-(?<year>\d{4})', then the variables ${day}, ${mon} and ${year} also become available for use in $With. Typically, $With is static text which is used to replace the $Pattern match and is inserted according to the Anchor match, (or indeed $Start or $End).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Move-Match</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Value</maml:name> <maml:description> <maml:para>The source value against which regular expressions are applied.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Cut</maml:name> <maml:description> <maml:para>Regular expression object that indicates which part of the $Value that either needs removed as part of overall rename operation. Those characters in $Value which match $Cut, are removed.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CutOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l</maml:para> <maml:para>* f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Diagnose</maml:name> <maml:description> <maml:para>switch parameter that indicates the command should be run in WhatIf mode. When enabled it presents additional information that assists the user in correcting the un-expected results caused by an incorrect/un-intended regular expression. The current diagnosis will show the contents of named capture groups that they may have specified. When an item is not renamed (usually because of an incorrect regular expression), the user can use the diagnostics along side the 'Not Renamed' reason to track down errors. When $Diagnose has been specified, $WhatIf does not need to be specified.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Marker</maml:name> <maml:description> <maml:para>A character used to mark the place where the $Pattern was removed from. It should be a special character that is not easily typed on the keyboard by the user so as to not interfere wth $Anchor/$Copy matches which occur after $Pattern match is removed.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Char</command:parameterValue> <dev:type> <maml:name>Char</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Anchor</maml:name> <maml:description> <maml:para>Anchor is a regular expression string applied to $Value (after the $Pattern match has been removed). The $Pattern match that is removed is inserted at the position indicated by the anchor match in collaboration with the $Relation parameter.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AnchorOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l</maml:para> <maml:para>* f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Copy</maml:name> <maml:description> <maml:para>Regular expression string applied to $Value (after the $Pattern match has been removed), indicating a portion which should be copied and re-inserted (via the $Paste parameter; see $Paste or $With). Since this is a regular expression to be used in $Paste/$With, there is no value in the user specifying a static pattern, because that static string can just be defined in $Paste/$With. The value in the $Copy parameter comes when a generic pattern is defined eg \d{3} (is non static), specifies any 3 digits as opposed to say '123', which could be used directly in the $Paste/$With parameter without the need for $Copy. The match defined by $Copy is stored in special variable ${_c} and can be referenced as such from $Paste and $With.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CopyOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l * f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Cut</maml:name> <maml:description> <maml:para>Regular expression object that indicates which part of the $Value that either needs removed as part of overall rename operation. Those characters in $Value which match $Cut, are removed.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CutOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l</maml:para> <maml:para>* f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Diagnose</maml:name> <maml:description> <maml:para>switch parameter that indicates the command should be run in WhatIf mode. When enabled it presents additional information that assists the user in correcting the un-expected results caused by an incorrect/un-intended regular expression. The current diagnosis will show the contents of named capture groups that they may have specified. When an item is not renamed (usually because of an incorrect regular expression), the user can use the diagnostics along side the 'Not Renamed' reason to track down errors. When $Diagnose has been specified, $WhatIf does not need to be specified.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Drop</maml:name> <maml:description> <maml:para>A string parameter (only applicable to move operations, ie any of these Anchor/Star/End are present) that defines what text is used to replace the $Pattern match. So in this use-case, the user wants to move a particular token/pattern to another part of the name and at the same time drop a static string in the place where the $Pattern was removed from. The user can also reference named group captures defined inside Pattern or Copy. (Note that the whole Copy capture can be referenced with ${_c}.)</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>End</maml:name> <maml:description> <maml:para>Is another type of anchor used instead of $Anchor and specifies that the $Pattern match should be moved to the end of the new name.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Marker</maml:name> <maml:description> <maml:para>A character used to mark the place where the $Pattern was removed from. It should be a special character that is not easily typed on the keyboard by the user so as to not interfere wth $Anchor/$Copy matches which occur after $Pattern match is removed.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Char</command:parameterValue> <dev:type> <maml:name>Char</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Pattern</maml:name> <maml:description> <maml:para>Regular expression object that indicates which part of the $Value that either needs to be moved or replaced as part of overall rename operation. Those characters in $Value which match $Pattern, are removed.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PatternOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l</maml:para> <maml:para>* f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Relation</maml:name> <maml:description> <maml:para>Used in conjunction with the $Anchor parameter and can be set to either 'before' or 'after' (the default). Defines the relationship of the $Pattern match with the $Anchor match in the new name for $Value.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Start</maml:name> <maml:description> <maml:para>Is another type of anchor used instead of $Anchor and specifies that the $Pattern match should be moved to the start of the new name.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Value</maml:name> <maml:description> <maml:para>The source value against which regular expressions are applied.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>With</maml:name> <maml:description> <maml:para>This is a NON regular expression string. It would be more accurately described as a formatter. Defines what text is used as the replacement for the $Pattern match. $With can reference special variables:</maml:para> <maml:para>* $0: the pattern match</maml:para> <maml:para>* ${_a}: the anchor match</maml:para> <maml:para>* ${_c}: the copy match</maml:para> <maml:para></maml:para> <maml:para>When $Pattern contains named capture groups, these variables can also be referenced. Eg if the $Pattern is defined as '(?<day>\d{1,2})-(?<mon>\d{1,2})-(?<year>\d{4})', then the variables ${day}, ${mon} and ${year} also become available for use in $With. Typically, $With is static text which is used to replace the $Pattern match and is inserted according to the Anchor match, (or indeed $Start or $End).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>---------------------- EXAMPLE 1 (Anchor) ----------------------</maml:title> <dev:code>Move-Match 'VAL 1999-02-21 + RH - CLOSE' '(?\<dt\>\d{4}-\d{2}-\d{2})' -Anchor ' -' -Relation 'before'</dev:code> <dev:remarks> <maml:para>Move a match before an anchor</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------------------- EXAMPLE 2 (Anchor) ----------------------</maml:title> <dev:code>Move-Match 'VAL 1999-02-21 + RH - CLOSE' '(?\<dt\>\d{4}-\d{2}-\d{2})' -Anchor ' -' -Relation 'before' -Drop '-'</dev:code> <dev:remarks> <maml:para>Move a match before an anchor and drop a literal in place of Pattern</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------------ EXAMPLE 3 (Hybrid Anchor) ------------------</maml:title> <dev:code>Move-Match 'VAL 1999-02-21 + RH - CLOSE' '(?\<dt\>\d{4}-\d{2}-\d{2})' -Anchor ' -' -End -Relation 'before' -Drop '-'</dev:code> <dev:remarks> <maml:para>Move a match before an anchor, if anchor match fails, then move to end, then drop a literal in place of Pattern.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------- EXAMPLE 4 (Anchor with Occurrence) --------------</maml:title> <dev:code>Move-Match 'VAL 1999-02-21 + RH - CLOSE' '(?\<dt\>\d{4}-\d{2}-\d{2})' -Anchor ' -' -Relation 'before' -AnchorOccurrence 'l'</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>- EXAMPLE 5 (Result formatted by With, named group reference) -</maml:title> <dev:code>Move-Match 'VAL 1999-02-21 + RH - CLOSE' '(?\<dt\>\d{4}-\d{2}-\d{2})' -Anchor ' -' -With '--(${dt})--'</dev:code> <dev:remarks> <maml:para>Move a match to the anchor, and format the output including group references, no anchor</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>EXAMPLE 6 (Result formatted by With, named group reference and insert anchor)</maml:title> <dev:code>Move-Match 'VAL 1999-02-21 + RH - CLOSE' '(?\<dt\>\d{4}-\d{2}-\d{2})' -Anchor ' -' -With '${_a}, --(${dt})--'</dev:code> <dev:remarks> <maml:para>Move a match to the anchor, and format the output including group references, insert anchor</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Elizium.RexFs</maml:linkText> <maml:uri>https://github.com/EliziumNet/RexFs</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Rename-Many</command:name> <command:verb>Rename</command:verb> <command:noun>Many</command:noun> <maml:description> <maml:para>Performs a bulk rename for all file system objects delivered through the pipeline, via regular expression replacement. For more information, please see Bulk Renamer (Rename-Many) (https://github.com/EliziumNet/RexFs/blob/master/README.md)</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The user should assemble the candidate items from the file system, be they files or directories typically using Get-ChildItem, or can be any other function that delivers file systems items via the PowerShell pipeline. For each item in the pipeline, Rename-Many will perform a rename.</maml:para> <maml:para>Rename-Many is a powerful command and should be used with caution. Because of the potential of accidental misuse, a number of protections have been put in place:</maml:para> <maml:para>* By default, the command is locked. This means that the command will not actually perform any renames until it has been unlocked by the user. When locked, the command runs as though -WhatIf has been specified. There are indications in the output to show that the command is in a locked state (there is an indicator in the batch header and a 'Novice' indicator in the summary). To activate the command, the user needs to set the environment variable 'REXFS_REMY_LOCKED' to $false. The user should not unlock the command until they are comfortable with how to use this command properly and knows how to write regular expressions correctly. (See regex101.com)</maml:para> <maml:para>* An undo script is generated by default. If the user has invoked a rename operation by accident without specifying $WhatIf (or any other WhatIf equivalent like $Diagnose) then the user can execute the undo script to reverse the rename operation. The user should clearly do this immediately on recognising the error of their ways. In a panic, the user may terminate the command via ctrl-c. In this case, a partial undo script is still generated and should contain the undo operations for the renames that were performed up to the point of the termination request. The name of the undo script is based upon the current date and time and is displayed in the summary. (The user can, if they wish disable the undo feature if they don't want to have to manage the accumulation of undo scripts, by setting the environment variable REXFS_REMY_UNDO_DISABLED to $true)</maml:para> <maml:para>Another important point of note is that there are currently 3 modes of operation: 'move', 'update' or 'cut':</maml:para> <maml:para>* 'move': requires an anchor, which may be an $Anchor pattern or either $Start or $End switches.</maml:para> <maml:para>* 'update': requires $With or $Paste without an anchor.</maml:para> <maml:para>* 'cut': no anchor or $With/$Paste specified, the $Pattern match is simply removed</maml:para> <maml:para> from the name.</maml:para> <maml:para>The following regular expression parameters:</maml:para> <maml:para>* $Pattern</maml:para> <maml:para>* $Anchor</maml:para> <maml:para>* $Copy</maml:para> <maml:para>can optionally have an occurrence value specified that can be used to select which match is active. In the case where a provided expression has multiple matches, the occurrence value can be used to single out which one. When no occurrence is specified, the default is the first match only. The occurrence for a parameter can be:</maml:para> <maml:para>* f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> <maml:para>The occurrence is specified after the regular expression eg: -Pattern '\w\d{2,3}', l which means match the Last occurrence of the expression. (Actually, an occurrence may be specified for $Include and $Except but there is no point in doing so because these patterns only provide a filtering function and play no part in the actual renaming process).</maml:para> <maml:para> A note about escaping. If a pattern needs to use an regular expression character as a literal, it must be escaped. There are multiple ways of doing this: * use the 'esc' function; eg: -Pattern $($esc('(\d{2})'))</maml:para> <maml:para>* use a leading ~; -Pattern '~(123)'</maml:para> <maml:para></maml:para> <maml:para>The above 2 approaches escape the entire string. The second approach is more concise and avoids the necessary use of extra brackets and $.</maml:para> <maml:para>* use 'esc' alongside other string concatenation: eg: -Pattern $($esc('(123)') + '-(?<ccy>GBP|SEK)'). This third method is required when the whole pattern should not be subjected to escaping.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Rename-Many</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="p"> <maml:name>Pattern</maml:name> <maml:description> <maml:para>Regular expression string that indicates which part of the pipeline items' name that either needs to be moved or replaced as part of bulk rename operation. Those characters in the name which match are removed from the name.</maml:para> <maml:para>The pattern can be followed by an occurrence indicator. As the $Pattern parameter is strictly speaking an array, the user can specify the occurrence after the regular expression eg:</maml:para> <maml:para> $Pattern '(?<code>\w\d{2})', l</maml:para> <maml:para> => This indicates that the last match should be captured into named group 'code'.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="a"> <maml:name>Anchor</maml:name> <maml:description> <maml:para>Indicates that the rename operation will be a move of the token from its original point to the point indicated by Anchor. Anchor is a regular expression string applied to the pipeline item's name (after the $Pattern match has been removed). The $Pattern match that is removed is inserted at the position indicated by the anchor match in collaboration with the $Relation parameter.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="w"> <maml:name>With</maml:name> <maml:description> <maml:para>This is a NON regular expression string. It would be more accurately described as a formatter, similar to the $Paste parameter. Defines what text is used as the replacement for the $Pattern match. Works in concert with $Relation (whereas $Paste does not). $With can reference special variables:</maml:para> <maml:para>* $0: the pattern match</maml:para> <maml:para>* ${_a}: the anchor match</maml:para> <maml:para>* ${_c}: the copy match</maml:para> <maml:para></maml:para> <maml:para>When $Pattern contains named capture groups, these variables can also be referenced. Eg if the $Pattern is defined as '(?<day>\d{1,2})-(?<mon>\d{1,2})-(?<year>\d{4})', then the variables ${day}, ${mon} and ${year} also become available for use in $With or $Paste. Typically, $With is static text which is used to replace the $Pattern match and is inserted according to the Anchor match, (or indeed $Start or $End) and $Relation. When using $With, whatever is defined in the $Anchor match is not removed from the pipeline's name (this is different to how $Paste works).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Condition</maml:name> <maml:description> <maml:para>Provides another way of filtering pipeline items. This is not typically specified on the command line, rather it is meant for those wanting to build functionality on top of Rename-Many.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue> <dev:type> <maml:name>ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Context</maml:name> <maml:description> <maml:para>Provides another way of customising Rename-Many. This is not typically specified on the command line, rather it is meant for those wanting to build functionality on top of Rename-Many. $Context should be a PSCustomObject with the following note properties:</maml:para> <maml:para>* Title (default: 'Rename') the name used in the batch header.</maml:para> <maml:para>* ItemMessage (default: 'Rename Item') the operation name used for each renamed item.</maml:para> <maml:para>* SummaryMessage (default: 'Rename Summary') the name used in the batch summary.</maml:para> <maml:para>* Locked (default: 'REXFS_REMY_LOCKED) the name of the environment variable which controls</maml:para> <maml:para>the locking of the command. * DisabledEnVar (default: 'REXFS_REMY_UNDO_DISABLED') the name of the environment variable which controls if the undo script feature is disabled. * UndoDisabledEnVar (default: 'REXFS_REMY_UNDO_DISABLED') the name of the environment variable which determines if the Undo feature is disabled. This allows any other function built on top of Rename-Many to control the undo feature for itself independently of Rename-Many.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue> <dev:type> <maml:name>PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="co"> <maml:name>Copy</maml:name> <maml:description> <maml:para>Regular expression string applied to the pipeline item's name (after the $Pattern match has been removed), indicating a portion which should be copied and re-inserted (via the $Paste parameter; see $Paste or $With). Since this is a regular expression to be used in $Paste/$With, there is no value in the user specifying a static pattern, because that static string can just be defined in $Paste/$With. The value in the $Copy parameter comes when a generic pattern is defined eg \d{3} (is non Literal), specifies any 3 digits as opposed to say '123', which could be used directly in the $Paste/$With parameter without the need for $Copy. The match defined by $Copy is stored in special variable ${_c} and can be referenced as such from $Paste and $With.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="dg"> <maml:name>Diagnose</maml:name> <maml:description> <maml:para>switch parameter that indicates the command should be run in WhatIf mode. When enabled it presents additional information that assists the user in correcting the un-expected results caused by an incorrect/un-intended regular expression. The current diagnosis will show the contents of named capture groups that they may have specified. When an item is not renamed (usually because of an incorrect regular expression), the user can use the diagnostics along side the 'Not Renamed' reason to track down errors. When $Diagnose has been specified, $WhatIf does not need to be specified.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="d"> <maml:name>Directory</maml:name> <maml:description> <maml:para>switch to indicate only Directory items in the pipeline will be processed. If neither this switch or the File switch are specified, then both File and Directory items are processed.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="dr"> <maml:name>Drop</maml:name> <maml:description> <maml:para>A string parameter (only applicable to move operations, ie Anchor/Star/End/hybrid) that defines what text is used to replace the Pattern match. So in this use-case, the user wants to move a particular token/pattern to another part of the name and at the same time drop a static string in the place where the $Pattern was removed from.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="x"> <maml:name>Except</maml:name> <maml:description> <maml:para>Regular expression string applied to the original pipeline item's name (before the $Pattern match has been removed). Allows the user to exclude some items that have been fed in via the pipeline. Those items that match the exclusion are skipped during the rename batch.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="f"> <maml:name>File</maml:name> <maml:description> <maml:para>switch to indicate only File items in the pipeline will be processed. If neither this switch or the Directory switch are specified, then both File and Directory items are processed.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="i"> <maml:name>Include</maml:name> <maml:description> <maml:para>Regular expression string applied to the original pipeline item's name (before the $Pattern match has been removed). Allows the user to include some items that have been fed in via the pipeline. Only those items that match $Include pattern are included during the rename batch, the others are skipped. The value of the Include parameter comes when you want to define a pattern which pipeline items match, without it be removed from the original name, which is what happens with $Pattern. Eg, the user may want to specify the only items that should be considered a candidate to be renamed are those that match a particular pattern but doing so in $Pattern would simply remove that pattern. That may be ok, but if it's not, the user should specify a pattern in the $Include and use $Pattern for the match you do want to be moved (with Anchor/Start/End) or replaced (with $With/$Paste).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="r"> <maml:name>Relation</maml:name> <maml:description> <maml:para>Used in conjunction with the $Anchor parameter and can be set to either 'before' or 'after' (the default). Defines the relationship of the $pattern match with the $Anchor match in the new name for the pipeline item.</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">before</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">after</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Test</maml:name> <maml:description> <maml:para>Required for unit tests only.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="t"> <maml:name>Top</maml:name> <maml:description> <maml:para>A number indicating how many items to process. If it is known that the number of items that will be candidates to be renamed is large, the user can limit this to the first $Top number of items. This is typically used as an exploratory tool, to determine the effects of the rename operation.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type> <maml:name>Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wh"> <maml:name>Whole</maml:name> <maml:description> <maml:para>Provides an alternative way to indicate that the regular expression parameters should be treated as a whole word (it just wraps the expression inside \b tokens). If set to '*', then it applies to all expression parameters otherwise a single letter can specify which of the parameters 'Whole' should be applied to. Valid values are:</maml:para> <maml:para>* 'p': $Pattern</maml:para> <maml:para>* 'a': $Anchor/AnchorEnd/AnchorStart</maml:para> <maml:para>* 'c': $Copy</maml:para> <maml:para>* 'i': $Include</maml:para> <maml:para>* 'x': $Except ' ': All the above (NB: Currently, can't be set to more than 1 of the above items at a time)</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">p</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">a</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">c</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">i</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">x</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">u</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">*</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>underscore</maml:name> <maml:description> <maml:para>The pipeline item which should either be an instance of FileInfo or DirectoryInfo.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">FileSystemInfo</command:parameterValue> <dev:type> <maml:name>FileSystemInfo</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Rename-Many</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="p"> <maml:name>Pattern</maml:name> <maml:description> <maml:para>Regular expression string that indicates which part of the pipeline items' name that either needs to be moved or replaced as part of bulk rename operation. Those characters in the name which match are removed from the name.</maml:para> <maml:para>The pattern can be followed by an occurrence indicator. As the $Pattern parameter is strictly speaking an array, the user can specify the occurrence after the regular expression eg:</maml:para> <maml:para> $Pattern '(?<code>\w\d{2})', l</maml:para> <maml:para> => This indicates that the last match should be captured into named group 'code'.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="ae"> <maml:name>AnchorEnd</maml:name> <maml:description> <maml:para>Similar to Anchor except that if the pattern specified by AnchorEnd does not match, then the Pattern match will be moved to the End. This is known as a Hybrid Anchor.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="w"> <maml:name>With</maml:name> <maml:description> <maml:para>This is a NON regular expression string. It would be more accurately described as a formatter, similar to the $Paste parameter. Defines what text is used as the replacement for the $Pattern match. Works in concert with $Relation (whereas $Paste does not). $With can reference special variables:</maml:para> <maml:para>* $0: the pattern match</maml:para> <maml:para>* ${_a}: the anchor match</maml:para> <maml:para>* ${_c}: the copy match</maml:para> <maml:para></maml:para> <maml:para>When $Pattern contains named capture groups, these variables can also be referenced. Eg if the $Pattern is defined as '(?<day>\d{1,2})-(?<mon>\d{1,2})-(?<year>\d{4})', then the variables ${day}, ${mon} and ${year} also become available for use in $With or $Paste. Typically, $With is static text which is used to replace the $Pattern match and is inserted according to the Anchor match, (or indeed $Start or $End) and $Relation. When using $With, whatever is defined in the $Anchor match is not removed from the pipeline's name (this is different to how $Paste works).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Condition</maml:name> <maml:description> <maml:para>Provides another way of filtering pipeline items. This is not typically specified on the command line, rather it is meant for those wanting to build functionality on top of Rename-Many.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue> <dev:type> <maml:name>ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Context</maml:name> <maml:description> <maml:para>Provides another way of customising Rename-Many. This is not typically specified on the command line, rather it is meant for those wanting to build functionality on top of Rename-Many. $Context should be a PSCustomObject with the following note properties:</maml:para> <maml:para>* Title (default: 'Rename') the name used in the batch header.</maml:para> <maml:para>* ItemMessage (default: 'Rename Item') the operation name used for each renamed item.</maml:para> <maml:para>* SummaryMessage (default: 'Rename Summary') the name used in the batch summary.</maml:para> <maml:para>* Locked (default: 'REXFS_REMY_LOCKED) the name of the environment variable which controls</maml:para> <maml:para>the locking of the command. * DisabledEnVar (default: 'REXFS_REMY_UNDO_DISABLED') the name of the environment variable which controls if the undo script feature is disabled. * UndoDisabledEnVar (default: 'REXFS_REMY_UNDO_DISABLED') the name of the environment variable which determines if the Undo feature is disabled. This allows any other function built on top of Rename-Many to control the undo feature for itself independently of Rename-Many.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue> <dev:type> <maml:name>PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="co"> <maml:name>Copy</maml:name> <maml:description> <maml:para>Regular expression string applied to the pipeline item's name (after the $Pattern match has been removed), indicating a portion which should be copied and re-inserted (via the $Paste parameter; see $Paste or $With). Since this is a regular expression to be used in $Paste/$With, there is no value in the user specifying a static pattern, because that static string can just be defined in $Paste/$With. The value in the $Copy parameter comes when a generic pattern is defined eg \d{3} (is non Literal), specifies any 3 digits as opposed to say '123', which could be used directly in the $Paste/$With parameter without the need for $Copy. The match defined by $Copy is stored in special variable ${_c} and can be referenced as such from $Paste and $With.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="dg"> <maml:name>Diagnose</maml:name> <maml:description> <maml:para>switch parameter that indicates the command should be run in WhatIf mode. When enabled it presents additional information that assists the user in correcting the un-expected results caused by an incorrect/un-intended regular expression. The current diagnosis will show the contents of named capture groups that they may have specified. When an item is not renamed (usually because of an incorrect regular expression), the user can use the diagnostics along side the 'Not Renamed' reason to track down errors. When $Diagnose has been specified, $WhatIf does not need to be specified.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="d"> <maml:name>Directory</maml:name> <maml:description> <maml:para>switch to indicate only Directory items in the pipeline will be processed. If neither this switch or the File switch are specified, then both File and Directory items are processed.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="dr"> <maml:name>Drop</maml:name> <maml:description> <maml:para>A string parameter (only applicable to move operations, ie Anchor/Star/End/hybrid) that defines what text is used to replace the Pattern match. So in this use-case, the user wants to move a particular token/pattern to another part of the name and at the same time drop a static string in the place where the $Pattern was removed from.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="x"> <maml:name>Except</maml:name> <maml:description> <maml:para>Regular expression string applied to the original pipeline item's name (before the $Pattern match has been removed). Allows the user to exclude some items that have been fed in via the pipeline. Those items that match the exclusion are skipped during the rename batch.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="f"> <maml:name>File</maml:name> <maml:description> <maml:para>switch to indicate only File items in the pipeline will be processed. If neither this switch or the Directory switch are specified, then both File and Directory items are processed.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="i"> <maml:name>Include</maml:name> <maml:description> <maml:para>Regular expression string applied to the original pipeline item's name (before the $Pattern match has been removed). Allows the user to include some items that have been fed in via the pipeline. Only those items that match $Include pattern are included during the rename batch, the others are skipped. The value of the Include parameter comes when you want to define a pattern which pipeline items match, without it be removed from the original name, which is what happens with $Pattern. Eg, the user may want to specify the only items that should be considered a candidate to be renamed are those that match a particular pattern but doing so in $Pattern would simply remove that pattern. That may be ok, but if it's not, the user should specify a pattern in the $Include and use $Pattern for the match you do want to be moved (with Anchor/Start/End) or replaced (with $With/$Paste).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="r"> <maml:name>Relation</maml:name> <maml:description> <maml:para>Used in conjunction with the $Anchor parameter and can be set to either 'before' or 'after' (the default). Defines the relationship of the $pattern match with the $Anchor match in the new name for the pipeline item.</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">before</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">after</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Test</maml:name> <maml:description> <maml:para>Required for unit tests only.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="t"> <maml:name>Top</maml:name> <maml:description> <maml:para>A number indicating how many items to process. If it is known that the number of items that will be candidates to be renamed is large, the user can limit this to the first $Top number of items. This is typically used as an exploratory tool, to determine the effects of the rename operation.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type> <maml:name>Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wh"> <maml:name>Whole</maml:name> <maml:description> <maml:para>Provides an alternative way to indicate that the regular expression parameters should be treated as a whole word (it just wraps the expression inside \b tokens). If set to '*', then it applies to all expression parameters otherwise a single letter can specify which of the parameters 'Whole' should be applied to. Valid values are:</maml:para> <maml:para>* 'p': $Pattern</maml:para> <maml:para>* 'a': $Anchor/AnchorEnd/AnchorStart</maml:para> <maml:para>* 'c': $Copy</maml:para> <maml:para>* 'i': $Include</maml:para> <maml:para>* 'x': $Except ' ': All the above (NB: Currently, can't be set to more than 1 of the above items at a time)</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">p</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">a</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">c</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">i</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">x</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">u</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">*</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>underscore</maml:name> <maml:description> <maml:para>The pipeline item which should either be an instance of FileInfo or DirectoryInfo.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">FileSystemInfo</command:parameterValue> <dev:type> <maml:name>FileSystemInfo</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Rename-Many</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="p"> <maml:name>Pattern</maml:name> <maml:description> <maml:para>Regular expression string that indicates which part of the pipeline items' name that either needs to be moved or replaced as part of bulk rename operation. Those characters in the name which match are removed from the name.</maml:para> <maml:para>The pattern can be followed by an occurrence indicator. As the $Pattern parameter is strictly speaking an array, the user can specify the occurrence after the regular expression eg:</maml:para> <maml:para> $Pattern '(?<code>\w\d{2})', l</maml:para> <maml:para> => This indicates that the last match should be captured into named group 'code'.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="as"> <maml:name>AnchorStart</maml:name> <maml:description> <maml:para>Similar to Anchor except that if the pattern specified by AnchorEnd does not match, then the Pattern match will be moved to the Start. This is known as a Hybrid Anchor.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="w"> <maml:name>With</maml:name> <maml:description> <maml:para>This is a NON regular expression string. It would be more accurately described as a formatter, similar to the $Paste parameter. Defines what text is used as the replacement for the $Pattern match. Works in concert with $Relation (whereas $Paste does not). $With can reference special variables:</maml:para> <maml:para>* $0: the pattern match</maml:para> <maml:para>* ${_a}: the anchor match</maml:para> <maml:para>* ${_c}: the copy match</maml:para> <maml:para></maml:para> <maml:para>When $Pattern contains named capture groups, these variables can also be referenced. Eg if the $Pattern is defined as '(?<day>\d{1,2})-(?<mon>\d{1,2})-(?<year>\d{4})', then the variables ${day}, ${mon} and ${year} also become available for use in $With or $Paste. Typically, $With is static text which is used to replace the $Pattern match and is inserted according to the Anchor match, (or indeed $Start or $End) and $Relation. When using $With, whatever is defined in the $Anchor match is not removed from the pipeline's name (this is different to how $Paste works).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Condition</maml:name> <maml:description> <maml:para>Provides another way of filtering pipeline items. This is not typically specified on the command line, rather it is meant for those wanting to build functionality on top of Rename-Many.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue> <dev:type> <maml:name>ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Context</maml:name> <maml:description> <maml:para>Provides another way of customising Rename-Many. This is not typically specified on the command line, rather it is meant for those wanting to build functionality on top of Rename-Many. $Context should be a PSCustomObject with the following note properties:</maml:para> <maml:para>* Title (default: 'Rename') the name used in the batch header.</maml:para> <maml:para>* ItemMessage (default: 'Rename Item') the operation name used for each renamed item.</maml:para> <maml:para>* SummaryMessage (default: 'Rename Summary') the name used in the batch summary.</maml:para> <maml:para>* Locked (default: 'REXFS_REMY_LOCKED) the name of the environment variable which controls</maml:para> <maml:para>the locking of the command. * DisabledEnVar (default: 'REXFS_REMY_UNDO_DISABLED') the name of the environment variable which controls if the undo script feature is disabled. * UndoDisabledEnVar (default: 'REXFS_REMY_UNDO_DISABLED') the name of the environment variable which determines if the Undo feature is disabled. This allows any other function built on top of Rename-Many to control the undo feature for itself independently of Rename-Many.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue> <dev:type> <maml:name>PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="co"> <maml:name>Copy</maml:name> <maml:description> <maml:para>Regular expression string applied to the pipeline item's name (after the $Pattern match has been removed), indicating a portion which should be copied and re-inserted (via the $Paste parameter; see $Paste or $With). Since this is a regular expression to be used in $Paste/$With, there is no value in the user specifying a static pattern, because that static string can just be defined in $Paste/$With. The value in the $Copy parameter comes when a generic pattern is defined eg \d{3} (is non Literal), specifies any 3 digits as opposed to say '123', which could be used directly in the $Paste/$With parameter without the need for $Copy. The match defined by $Copy is stored in special variable ${_c} and can be referenced as such from $Paste and $With.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="dg"> <maml:name>Diagnose</maml:name> <maml:description> <maml:para>switch parameter that indicates the command should be run in WhatIf mode. When enabled it presents additional information that assists the user in correcting the un-expected results caused by an incorrect/un-intended regular expression. The current diagnosis will show the contents of named capture groups that they may have specified. When an item is not renamed (usually because of an incorrect regular expression), the user can use the diagnostics along side the 'Not Renamed' reason to track down errors. When $Diagnose has been specified, $WhatIf does not need to be specified.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="d"> <maml:name>Directory</maml:name> <maml:description> <maml:para>switch to indicate only Directory items in the pipeline will be processed. If neither this switch or the File switch are specified, then both File and Directory items are processed.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="dr"> <maml:name>Drop</maml:name> <maml:description> <maml:para>A string parameter (only applicable to move operations, ie Anchor/Star/End/hybrid) that defines what text is used to replace the Pattern match. So in this use-case, the user wants to move a particular token/pattern to another part of the name and at the same time drop a static string in the place where the $Pattern was removed from.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="x"> <maml:name>Except</maml:name> <maml:description> <maml:para>Regular expression string applied to the original pipeline item's name (before the $Pattern match has been removed). Allows the user to exclude some items that have been fed in via the pipeline. Those items that match the exclusion are skipped during the rename batch.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="f"> <maml:name>File</maml:name> <maml:description> <maml:para>switch to indicate only File items in the pipeline will be processed. If neither this switch or the Directory switch are specified, then both File and Directory items are processed.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="i"> <maml:name>Include</maml:name> <maml:description> <maml:para>Regular expression string applied to the original pipeline item's name (before the $Pattern match has been removed). Allows the user to include some items that have been fed in via the pipeline. Only those items that match $Include pattern are included during the rename batch, the others are skipped. The value of the Include parameter comes when you want to define a pattern which pipeline items match, without it be removed from the original name, which is what happens with $Pattern. Eg, the user may want to specify the only items that should be considered a candidate to be renamed are those that match a particular pattern but doing so in $Pattern would simply remove that pattern. That may be ok, but if it's not, the user should specify a pattern in the $Include and use $Pattern for the match you do want to be moved (with Anchor/Start/End) or replaced (with $With/$Paste).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="r"> <maml:name>Relation</maml:name> <maml:description> <maml:para>Used in conjunction with the $Anchor parameter and can be set to either 'before' or 'after' (the default). Defines the relationship of the $pattern match with the $Anchor match in the new name for the pipeline item.</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">before</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">after</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Test</maml:name> <maml:description> <maml:para>Required for unit tests only.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="t"> <maml:name>Top</maml:name> <maml:description> <maml:para>A number indicating how many items to process. If it is known that the number of items that will be candidates to be renamed is large, the user can limit this to the first $Top number of items. This is typically used as an exploratory tool, to determine the effects of the rename operation.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type> <maml:name>Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wh"> <maml:name>Whole</maml:name> <maml:description> <maml:para>Provides an alternative way to indicate that the regular expression parameters should be treated as a whole word (it just wraps the expression inside \b tokens). If set to '*', then it applies to all expression parameters otherwise a single letter can specify which of the parameters 'Whole' should be applied to. Valid values are:</maml:para> <maml:para>* 'p': $Pattern</maml:para> <maml:para>* 'a': $Anchor/AnchorEnd/AnchorStart</maml:para> <maml:para>* 'c': $Copy</maml:para> <maml:para>* 'i': $Include</maml:para> <maml:para>* 'x': $Except ' ': All the above (NB: Currently, can't be set to more than 1 of the above items at a time)</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">p</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">a</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">c</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">i</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">x</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">u</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">*</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>underscore</maml:name> <maml:description> <maml:para>The pipeline item which should either be an instance of FileInfo or DirectoryInfo.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">FileSystemInfo</command:parameterValue> <dev:type> <maml:name>FileSystemInfo</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Rename-Many</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="ap"> <maml:name>Append</maml:name> <maml:description> <maml:para>Appends a literal string to end of items name</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Condition</maml:name> <maml:description> <maml:para>Provides another way of filtering pipeline items. This is not typically specified on the command line, rather it is meant for those wanting to build functionality on top of Rename-Many.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue> <dev:type> <maml:name>ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Context</maml:name> <maml:description> <maml:para>Provides another way of customising Rename-Many. This is not typically specified on the command line, rather it is meant for those wanting to build functionality on top of Rename-Many. $Context should be a PSCustomObject with the following note properties:</maml:para> <maml:para>* Title (default: 'Rename') the name used in the batch header.</maml:para> <maml:para>* ItemMessage (default: 'Rename Item') the operation name used for each renamed item.</maml:para> <maml:para>* SummaryMessage (default: 'Rename Summary') the name used in the batch summary.</maml:para> <maml:para>* Locked (default: 'REXFS_REMY_LOCKED) the name of the environment variable which controls</maml:para> <maml:para>the locking of the command. * DisabledEnVar (default: 'REXFS_REMY_UNDO_DISABLED') the name of the environment variable which controls if the undo script feature is disabled. * UndoDisabledEnVar (default: 'REXFS_REMY_UNDO_DISABLED') the name of the environment variable which determines if the Undo feature is disabled. This allows any other function built on top of Rename-Many to control the undo feature for itself independently of Rename-Many.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue> <dev:type> <maml:name>PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="co"> <maml:name>Copy</maml:name> <maml:description> <maml:para>Regular expression string applied to the pipeline item's name (after the $Pattern match has been removed), indicating a portion which should be copied and re-inserted (via the $Paste parameter; see $Paste or $With). Since this is a regular expression to be used in $Paste/$With, there is no value in the user specifying a static pattern, because that static string can just be defined in $Paste/$With. The value in the $Copy parameter comes when a generic pattern is defined eg \d{3} (is non Literal), specifies any 3 digits as opposed to say '123', which could be used directly in the $Paste/$With parameter without the need for $Copy. The match defined by $Copy is stored in special variable ${_c} and can be referenced as such from $Paste and $With.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="dg"> <maml:name>Diagnose</maml:name> <maml:description> <maml:para>switch parameter that indicates the command should be run in WhatIf mode. When enabled it presents additional information that assists the user in correcting the un-expected results caused by an incorrect/un-intended regular expression. The current diagnosis will show the contents of named capture groups that they may have specified. When an item is not renamed (usually because of an incorrect regular expression), the user can use the diagnostics along side the 'Not Renamed' reason to track down errors. When $Diagnose has been specified, $WhatIf does not need to be specified.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="d"> <maml:name>Directory</maml:name> <maml:description> <maml:para>switch to indicate only Directory items in the pipeline will be processed. If neither this switch or the File switch are specified, then both File and Directory items are processed.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="x"> <maml:name>Except</maml:name> <maml:description> <maml:para>Regular expression string applied to the original pipeline item's name (before the $Pattern match has been removed). Allows the user to exclude some items that have been fed in via the pipeline. Those items that match the exclusion are skipped during the rename batch.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="f"> <maml:name>File</maml:name> <maml:description> <maml:para>switch to indicate only File items in the pipeline will be processed. If neither this switch or the Directory switch are specified, then both File and Directory items are processed.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="i"> <maml:name>Include</maml:name> <maml:description> <maml:para>Regular expression string applied to the original pipeline item's name (before the $Pattern match has been removed). Allows the user to include some items that have been fed in via the pipeline. Only those items that match $Include pattern are included during the rename batch, the others are skipped. The value of the Include parameter comes when you want to define a pattern which pipeline items match, without it be removed from the original name, which is what happens with $Pattern. Eg, the user may want to specify the only items that should be considered a candidate to be renamed are those that match a particular pattern but doing so in $Pattern would simply remove that pattern. That may be ok, but if it's not, the user should specify a pattern in the $Include and use $Pattern for the match you do want to be moved (with Anchor/Start/End) or replaced (with $With/$Paste).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Test</maml:name> <maml:description> <maml:para>Required for unit tests only.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="t"> <maml:name>Top</maml:name> <maml:description> <maml:para>A number indicating how many items to process. If it is known that the number of items that will be candidates to be renamed is large, the user can limit this to the first $Top number of items. This is typically used as an exploratory tool, to determine the effects of the rename operation.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type> <maml:name>Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wh"> <maml:name>Whole</maml:name> <maml:description> <maml:para>Provides an alternative way to indicate that the regular expression parameters should be treated as a whole word (it just wraps the expression inside \b tokens). If set to '*', then it applies to all expression parameters otherwise a single letter can specify which of the parameters 'Whole' should be applied to. Valid values are:</maml:para> <maml:para>* 'p': $Pattern</maml:para> <maml:para>* 'a': $Anchor/AnchorEnd/AnchorStart</maml:para> <maml:para>* 'c': $Copy</maml:para> <maml:para>* 'i': $Include</maml:para> <maml:para>* 'x': $Except ' ': All the above (NB: Currently, can't be set to more than 1 of the above items at a time)</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">p</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">a</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">c</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">i</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">x</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">u</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">*</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>underscore</maml:name> <maml:description> <maml:para>The pipeline item which should either be an instance of FileInfo or DirectoryInfo.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">FileSystemInfo</command:parameterValue> <dev:type> <maml:name>FileSystemInfo</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Rename-Many</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="p"> <maml:name>Pattern</maml:name> <maml:description> <maml:para>Regular expression string that indicates which part of the pipeline items' name that either needs to be moved or replaced as part of bulk rename operation. Those characters in the name which match are removed from the name.</maml:para> <maml:para>The pattern can be followed by an occurrence indicator. As the $Pattern parameter is strictly speaking an array, the user can specify the occurrence after the regular expression eg:</maml:para> <maml:para> $Pattern '(?<code>\w\d{2})', l</maml:para> <maml:para> => This indicates that the last match should be captured into named group 'code'.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="w"> <maml:name>With</maml:name> <maml:description> <maml:para>This is a NON regular expression string. It would be more accurately described as a formatter, similar to the $Paste parameter. Defines what text is used as the replacement for the $Pattern match. Works in concert with $Relation (whereas $Paste does not). $With can reference special variables:</maml:para> <maml:para>* $0: the pattern match</maml:para> <maml:para>* ${_a}: the anchor match</maml:para> <maml:para>* ${_c}: the copy match</maml:para> <maml:para></maml:para> <maml:para>When $Pattern contains named capture groups, these variables can also be referenced. Eg if the $Pattern is defined as '(?<day>\d{1,2})-(?<mon>\d{1,2})-(?<year>\d{4})', then the variables ${day}, ${mon} and ${year} also become available for use in $With or $Paste. Typically, $With is static text which is used to replace the $Pattern match and is inserted according to the Anchor match, (or indeed $Start or $End) and $Relation. When using $With, whatever is defined in the $Anchor match is not removed from the pipeline's name (this is different to how $Paste works).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Condition</maml:name> <maml:description> <maml:para>Provides another way of filtering pipeline items. This is not typically specified on the command line, rather it is meant for those wanting to build functionality on top of Rename-Many.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue> <dev:type> <maml:name>ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Context</maml:name> <maml:description> <maml:para>Provides another way of customising Rename-Many. This is not typically specified on the command line, rather it is meant for those wanting to build functionality on top of Rename-Many. $Context should be a PSCustomObject with the following note properties:</maml:para> <maml:para>* Title (default: 'Rename') the name used in the batch header.</maml:para> <maml:para>* ItemMessage (default: 'Rename Item') the operation name used for each renamed item.</maml:para> <maml:para>* SummaryMessage (default: 'Rename Summary') the name used in the batch summary.</maml:para> <maml:para>* Locked (default: 'REXFS_REMY_LOCKED) the name of the environment variable which controls</maml:para> <maml:para>the locking of the command. * DisabledEnVar (default: 'REXFS_REMY_UNDO_DISABLED') the name of the environment variable which controls if the undo script feature is disabled. * UndoDisabledEnVar (default: 'REXFS_REMY_UNDO_DISABLED') the name of the environment variable which determines if the Undo feature is disabled. This allows any other function built on top of Rename-Many to control the undo feature for itself independently of Rename-Many.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue> <dev:type> <maml:name>PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="co"> <maml:name>Copy</maml:name> <maml:description> <maml:para>Regular expression string applied to the pipeline item's name (after the $Pattern match has been removed), indicating a portion which should be copied and re-inserted (via the $Paste parameter; see $Paste or $With). Since this is a regular expression to be used in $Paste/$With, there is no value in the user specifying a static pattern, because that static string can just be defined in $Paste/$With. The value in the $Copy parameter comes when a generic pattern is defined eg \d{3} (is non Literal), specifies any 3 digits as opposed to say '123', which could be used directly in the $Paste/$With parameter without the need for $Copy. The match defined by $Copy is stored in special variable ${_c} and can be referenced as such from $Paste and $With.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="dg"> <maml:name>Diagnose</maml:name> <maml:description> <maml:para>switch parameter that indicates the command should be run in WhatIf mode. When enabled it presents additional information that assists the user in correcting the un-expected results caused by an incorrect/un-intended regular expression. The current diagnosis will show the contents of named capture groups that they may have specified. When an item is not renamed (usually because of an incorrect regular expression), the user can use the diagnostics along side the 'Not Renamed' reason to track down errors. When $Diagnose has been specified, $WhatIf does not need to be specified.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="d"> <maml:name>Directory</maml:name> <maml:description> <maml:para>switch to indicate only Directory items in the pipeline will be processed. If neither this switch or the File switch are specified, then both File and Directory items are processed.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="x"> <maml:name>Except</maml:name> <maml:description> <maml:para>Regular expression string applied to the original pipeline item's name (before the $Pattern match has been removed). Allows the user to exclude some items that have been fed in via the pipeline. Those items that match the exclusion are skipped during the rename batch.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="f"> <maml:name>File</maml:name> <maml:description> <maml:para>switch to indicate only File items in the pipeline will be processed. If neither this switch or the Directory switch are specified, then both File and Directory items are processed.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="i"> <maml:name>Include</maml:name> <maml:description> <maml:para>Regular expression string applied to the original pipeline item's name (before the $Pattern match has been removed). Allows the user to include some items that have been fed in via the pipeline. Only those items that match $Include pattern are included during the rename batch, the others are skipped. The value of the Include parameter comes when you want to define a pattern which pipeline items match, without it be removed from the original name, which is what happens with $Pattern. Eg, the user may want to specify the only items that should be considered a candidate to be renamed are those that match a particular pattern but doing so in $Pattern would simply remove that pattern. That may be ok, but if it's not, the user should specify a pattern in the $Include and use $Pattern for the match you do want to be moved (with Anchor/Start/End) or replaced (with $With/$Paste).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="ps"> <maml:name>Paste</maml:name> <maml:description> <maml:para>Formatter parameter for Update operations. Can contain named/numbered group references defined inside regular expression parameters, or use special named references $0 for the whole Pattern match and ${_c} for the whole Copy match.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Test</maml:name> <maml:description> <maml:para>Required for unit tests only.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="t"> <maml:name>Top</maml:name> <maml:description> <maml:para>A number indicating how many items to process. If it is known that the number of items that will be candidates to be renamed is large, the user can limit this to the first $Top number of items. This is typically used as an exploratory tool, to determine the effects of the rename operation.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type> <maml:name>Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wh"> <maml:name>Whole</maml:name> <maml:description> <maml:para>Provides an alternative way to indicate that the regular expression parameters should be treated as a whole word (it just wraps the expression inside \b tokens). If set to '*', then it applies to all expression parameters otherwise a single letter can specify which of the parameters 'Whole' should be applied to. Valid values are:</maml:para> <maml:para>* 'p': $Pattern</maml:para> <maml:para>* 'a': $Anchor/AnchorEnd/AnchorStart</maml:para> <maml:para>* 'c': $Copy</maml:para> <maml:para>* 'i': $Include</maml:para> <maml:para>* 'x': $Except ' ': All the above (NB: Currently, can't be set to more than 1 of the above items at a time)</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">p</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">a</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">c</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">i</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">x</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">u</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">*</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>underscore</maml:name> <maml:description> <maml:para>The pipeline item which should either be an instance of FileInfo or DirectoryInfo.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">FileSystemInfo</command:parameterValue> <dev:type> <maml:name>FileSystemInfo</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Rename-Many</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="p"> <maml:name>Pattern</maml:name> <maml:description> <maml:para>Regular expression string that indicates which part of the pipeline items' name that either needs to be moved or replaced as part of bulk rename operation. Those characters in the name which match are removed from the name.</maml:para> <maml:para>The pattern can be followed by an occurrence indicator. As the $Pattern parameter is strictly speaking an array, the user can specify the occurrence after the regular expression eg:</maml:para> <maml:para> $Pattern '(?<code>\w\d{2})', l</maml:para> <maml:para> => This indicates that the last match should be captured into named group 'code'.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="w"> <maml:name>With</maml:name> <maml:description> <maml:para>This is a NON regular expression string. It would be more accurately described as a formatter, similar to the $Paste parameter. Defines what text is used as the replacement for the $Pattern match. Works in concert with $Relation (whereas $Paste does not). $With can reference special variables:</maml:para> <maml:para>* $0: the pattern match</maml:para> <maml:para>* ${_a}: the anchor match</maml:para> <maml:para>* ${_c}: the copy match</maml:para> <maml:para></maml:para> <maml:para>When $Pattern contains named capture groups, these variables can also be referenced. Eg if the $Pattern is defined as '(?<day>\d{1,2})-(?<mon>\d{1,2})-(?<year>\d{4})', then the variables ${day}, ${mon} and ${year} also become available for use in $With or $Paste. Typically, $With is static text which is used to replace the $Pattern match and is inserted according to the Anchor match, (or indeed $Start or $End) and $Relation. When using $With, whatever is defined in the $Anchor match is not removed from the pipeline's name (this is different to how $Paste works).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Condition</maml:name> <maml:description> <maml:para>Provides another way of filtering pipeline items. This is not typically specified on the command line, rather it is meant for those wanting to build functionality on top of Rename-Many.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue> <dev:type> <maml:name>ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Context</maml:name> <maml:description> <maml:para>Provides another way of customising Rename-Many. This is not typically specified on the command line, rather it is meant for those wanting to build functionality on top of Rename-Many. $Context should be a PSCustomObject with the following note properties:</maml:para> <maml:para>* Title (default: 'Rename') the name used in the batch header.</maml:para> <maml:para>* ItemMessage (default: 'Rename Item') the operation name used for each renamed item.</maml:para> <maml:para>* SummaryMessage (default: 'Rename Summary') the name used in the batch summary.</maml:para> <maml:para>* Locked (default: 'REXFS_REMY_LOCKED) the name of the environment variable which controls</maml:para> <maml:para>the locking of the command. * DisabledEnVar (default: 'REXFS_REMY_UNDO_DISABLED') the name of the environment variable which controls if the undo script feature is disabled. * UndoDisabledEnVar (default: 'REXFS_REMY_UNDO_DISABLED') the name of the environment variable which determines if the Undo feature is disabled. This allows any other function built on top of Rename-Many to control the undo feature for itself independently of Rename-Many.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue> <dev:type> <maml:name>PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="co"> <maml:name>Copy</maml:name> <maml:description> <maml:para>Regular expression string applied to the pipeline item's name (after the $Pattern match has been removed), indicating a portion which should be copied and re-inserted (via the $Paste parameter; see $Paste or $With). Since this is a regular expression to be used in $Paste/$With, there is no value in the user specifying a static pattern, because that static string can just be defined in $Paste/$With. The value in the $Copy parameter comes when a generic pattern is defined eg \d{3} (is non Literal), specifies any 3 digits as opposed to say '123', which could be used directly in the $Paste/$With parameter without the need for $Copy. The match defined by $Copy is stored in special variable ${_c} and can be referenced as such from $Paste and $With.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="dg"> <maml:name>Diagnose</maml:name> <maml:description> <maml:para>switch parameter that indicates the command should be run in WhatIf mode. When enabled it presents additional information that assists the user in correcting the un-expected results caused by an incorrect/un-intended regular expression. The current diagnosis will show the contents of named capture groups that they may have specified. When an item is not renamed (usually because of an incorrect regular expression), the user can use the diagnostics along side the 'Not Renamed' reason to track down errors. When $Diagnose has been specified, $WhatIf does not need to be specified.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="d"> <maml:name>Directory</maml:name> <maml:description> <maml:para>switch to indicate only Directory items in the pipeline will be processed. If neither this switch or the File switch are specified, then both File and Directory items are processed.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="dr"> <maml:name>Drop</maml:name> <maml:description> <maml:para>A string parameter (only applicable to move operations, ie Anchor/Star/End/hybrid) that defines what text is used to replace the Pattern match. So in this use-case, the user wants to move a particular token/pattern to another part of the name and at the same time drop a static string in the place where the $Pattern was removed from.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="e"> <maml:name>End</maml:name> <maml:description> <maml:para>Is another type of anchor used instead of $Anchor and specifies that the $Pattern match should be moved to the end of the new name.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="x"> <maml:name>Except</maml:name> <maml:description> <maml:para>Regular expression string applied to the original pipeline item's name (before the $Pattern match has been removed). Allows the user to exclude some items that have been fed in via the pipeline. Those items that match the exclusion are skipped during the rename batch.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="f"> <maml:name>File</maml:name> <maml:description> <maml:para>switch to indicate only File items in the pipeline will be processed. If neither this switch or the Directory switch are specified, then both File and Directory items are processed.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="i"> <maml:name>Include</maml:name> <maml:description> <maml:para>Regular expression string applied to the original pipeline item's name (before the $Pattern match has been removed). Allows the user to include some items that have been fed in via the pipeline. Only those items that match $Include pattern are included during the rename batch, the others are skipped. The value of the Include parameter comes when you want to define a pattern which pipeline items match, without it be removed from the original name, which is what happens with $Pattern. Eg, the user may want to specify the only items that should be considered a candidate to be renamed are those that match a particular pattern but doing so in $Pattern would simply remove that pattern. That may be ok, but if it's not, the user should specify a pattern in the $Include and use $Pattern for the match you do want to be moved (with Anchor/Start/End) or replaced (with $With/$Paste).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Test</maml:name> <maml:description> <maml:para>Required for unit tests only.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="t"> <maml:name>Top</maml:name> <maml:description> <maml:para>A number indicating how many items to process. If it is known that the number of items that will be candidates to be renamed is large, the user can limit this to the first $Top number of items. This is typically used as an exploratory tool, to determine the effects of the rename operation.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type> <maml:name>Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wh"> <maml:name>Whole</maml:name> <maml:description> <maml:para>Provides an alternative way to indicate that the regular expression parameters should be treated as a whole word (it just wraps the expression inside \b tokens). If set to '*', then it applies to all expression parameters otherwise a single letter can specify which of the parameters 'Whole' should be applied to. Valid values are:</maml:para> <maml:para>* 'p': $Pattern</maml:para> <maml:para>* 'a': $Anchor/AnchorEnd/AnchorStart</maml:para> <maml:para>* 'c': $Copy</maml:para> <maml:para>* 'i': $Include</maml:para> <maml:para>* 'x': $Except ' ': All the above (NB: Currently, can't be set to more than 1 of the above items at a time)</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">p</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">a</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">c</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">i</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">x</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">u</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">*</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>underscore</maml:name> <maml:description> <maml:para>The pipeline item which should either be an instance of FileInfo or DirectoryInfo.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">FileSystemInfo</command:parameterValue> <dev:type> <maml:name>FileSystemInfo</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Rename-Many</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="p"> <maml:name>Pattern</maml:name> <maml:description> <maml:para>Regular expression string that indicates which part of the pipeline items' name that either needs to be moved or replaced as part of bulk rename operation. Those characters in the name which match are removed from the name.</maml:para> <maml:para>The pattern can be followed by an occurrence indicator. As the $Pattern parameter is strictly speaking an array, the user can specify the occurrence after the regular expression eg:</maml:para> <maml:para> $Pattern '(?<code>\w\d{2})', l</maml:para> <maml:para> => This indicates that the last match should be captured into named group 'code'.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="w"> <maml:name>With</maml:name> <maml:description> <maml:para>This is a NON regular expression string. It would be more accurately described as a formatter, similar to the $Paste parameter. Defines what text is used as the replacement for the $Pattern match. Works in concert with $Relation (whereas $Paste does not). $With can reference special variables:</maml:para> <maml:para>* $0: the pattern match</maml:para> <maml:para>* ${_a}: the anchor match</maml:para> <maml:para>* ${_c}: the copy match</maml:para> <maml:para></maml:para> <maml:para>When $Pattern contains named capture groups, these variables can also be referenced. Eg if the $Pattern is defined as '(?<day>\d{1,2})-(?<mon>\d{1,2})-(?<year>\d{4})', then the variables ${day}, ${mon} and ${year} also become available for use in $With or $Paste. Typically, $With is static text which is used to replace the $Pattern match and is inserted according to the Anchor match, (or indeed $Start or $End) and $Relation. When using $With, whatever is defined in the $Anchor match is not removed from the pipeline's name (this is different to how $Paste works).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Condition</maml:name> <maml:description> <maml:para>Provides another way of filtering pipeline items. This is not typically specified on the command line, rather it is meant for those wanting to build functionality on top of Rename-Many.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue> <dev:type> <maml:name>ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Context</maml:name> <maml:description> <maml:para>Provides another way of customising Rename-Many. This is not typically specified on the command line, rather it is meant for those wanting to build functionality on top of Rename-Many. $Context should be a PSCustomObject with the following note properties:</maml:para> <maml:para>* Title (default: 'Rename') the name used in the batch header.</maml:para> <maml:para>* ItemMessage (default: 'Rename Item') the operation name used for each renamed item.</maml:para> <maml:para>* SummaryMessage (default: 'Rename Summary') the name used in the batch summary.</maml:para> <maml:para>* Locked (default: 'REXFS_REMY_LOCKED) the name of the environment variable which controls</maml:para> <maml:para>the locking of the command. * DisabledEnVar (default: 'REXFS_REMY_UNDO_DISABLED') the name of the environment variable which controls if the undo script feature is disabled. * UndoDisabledEnVar (default: 'REXFS_REMY_UNDO_DISABLED') the name of the environment variable which determines if the Undo feature is disabled. This allows any other function built on top of Rename-Many to control the undo feature for itself independently of Rename-Many.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue> <dev:type> <maml:name>PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="co"> <maml:name>Copy</maml:name> <maml:description> <maml:para>Regular expression string applied to the pipeline item's name (after the $Pattern match has been removed), indicating a portion which should be copied and re-inserted (via the $Paste parameter; see $Paste or $With). Since this is a regular expression to be used in $Paste/$With, there is no value in the user specifying a static pattern, because that static string can just be defined in $Paste/$With. The value in the $Copy parameter comes when a generic pattern is defined eg \d{3} (is non Literal), specifies any 3 digits as opposed to say '123', which could be used directly in the $Paste/$With parameter without the need for $Copy. The match defined by $Copy is stored in special variable ${_c} and can be referenced as such from $Paste and $With.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="dg"> <maml:name>Diagnose</maml:name> <maml:description> <maml:para>switch parameter that indicates the command should be run in WhatIf mode. When enabled it presents additional information that assists the user in correcting the un-expected results caused by an incorrect/un-intended regular expression. The current diagnosis will show the contents of named capture groups that they may have specified. When an item is not renamed (usually because of an incorrect regular expression), the user can use the diagnostics along side the 'Not Renamed' reason to track down errors. When $Diagnose has been specified, $WhatIf does not need to be specified.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="d"> <maml:name>Directory</maml:name> <maml:description> <maml:para>switch to indicate only Directory items in the pipeline will be processed. If neither this switch or the File switch are specified, then both File and Directory items are processed.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="dr"> <maml:name>Drop</maml:name> <maml:description> <maml:para>A string parameter (only applicable to move operations, ie Anchor/Star/End/hybrid) that defines what text is used to replace the Pattern match. So in this use-case, the user wants to move a particular token/pattern to another part of the name and at the same time drop a static string in the place where the $Pattern was removed from.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="x"> <maml:name>Except</maml:name> <maml:description> <maml:para>Regular expression string applied to the original pipeline item's name (before the $Pattern match has been removed). Allows the user to exclude some items that have been fed in via the pipeline. Those items that match the exclusion are skipped during the rename batch.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="f"> <maml:name>File</maml:name> <maml:description> <maml:para>switch to indicate only File items in the pipeline will be processed. If neither this switch or the Directory switch are specified, then both File and Directory items are processed.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="i"> <maml:name>Include</maml:name> <maml:description> <maml:para>Regular expression string applied to the original pipeline item's name (before the $Pattern match has been removed). Allows the user to include some items that have been fed in via the pipeline. Only those items that match $Include pattern are included during the rename batch, the others are skipped. The value of the Include parameter comes when you want to define a pattern which pipeline items match, without it be removed from the original name, which is what happens with $Pattern. Eg, the user may want to specify the only items that should be considered a candidate to be renamed are those that match a particular pattern but doing so in $Pattern would simply remove that pattern. That may be ok, but if it's not, the user should specify a pattern in the $Include and use $Pattern for the match you do want to be moved (with Anchor/Start/End) or replaced (with $With/$Paste).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="s"> <maml:name>Start</maml:name> <maml:description> <maml:para>Is another type of anchor used instead of $Anchor and specifies that the $Pattern match should be moved to the start of the new name.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Test</maml:name> <maml:description> <maml:para>Required for unit tests only.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="t"> <maml:name>Top</maml:name> <maml:description> <maml:para>A number indicating how many items to process. If it is known that the number of items that will be candidates to be renamed is large, the user can limit this to the first $Top number of items. This is typically used as an exploratory tool, to determine the effects of the rename operation.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type> <maml:name>Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wh"> <maml:name>Whole</maml:name> <maml:description> <maml:para>Provides an alternative way to indicate that the regular expression parameters should be treated as a whole word (it just wraps the expression inside \b tokens). If set to '*', then it applies to all expression parameters otherwise a single letter can specify which of the parameters 'Whole' should be applied to. Valid values are:</maml:para> <maml:para>* 'p': $Pattern</maml:para> <maml:para>* 'a': $Anchor/AnchorEnd/AnchorStart</maml:para> <maml:para>* 'c': $Copy</maml:para> <maml:para>* 'i': $Include</maml:para> <maml:para>* 'x': $Except ' ': All the above (NB: Currently, can't be set to more than 1 of the above items at a time)</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">p</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">a</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">c</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">i</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">x</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">u</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">*</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>underscore</maml:name> <maml:description> <maml:para>The pipeline item which should either be an instance of FileInfo or DirectoryInfo.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">FileSystemInfo</command:parameterValue> <dev:type> <maml:name>FileSystemInfo</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Rename-Many</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Condition</maml:name> <maml:description> <maml:para>Provides another way of filtering pipeline items. This is not typically specified on the command line, rather it is meant for those wanting to build functionality on top of Rename-Many.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue> <dev:type> <maml:name>ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Context</maml:name> <maml:description> <maml:para>Provides another way of customising Rename-Many. This is not typically specified on the command line, rather it is meant for those wanting to build functionality on top of Rename-Many. $Context should be a PSCustomObject with the following note properties:</maml:para> <maml:para>* Title (default: 'Rename') the name used in the batch header.</maml:para> <maml:para>* ItemMessage (default: 'Rename Item') the operation name used for each renamed item.</maml:para> <maml:para>* SummaryMessage (default: 'Rename Summary') the name used in the batch summary.</maml:para> <maml:para>* Locked (default: 'REXFS_REMY_LOCKED) the name of the environment variable which controls</maml:para> <maml:para>the locking of the command. * DisabledEnVar (default: 'REXFS_REMY_UNDO_DISABLED') the name of the environment variable which controls if the undo script feature is disabled. * UndoDisabledEnVar (default: 'REXFS_REMY_UNDO_DISABLED') the name of the environment variable which determines if the Undo feature is disabled. This allows any other function built on top of Rename-Many to control the undo feature for itself independently of Rename-Many.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue> <dev:type> <maml:name>PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="co"> <maml:name>Copy</maml:name> <maml:description> <maml:para>Regular expression string applied to the pipeline item's name (after the $Pattern match has been removed), indicating a portion which should be copied and re-inserted (via the $Paste parameter; see $Paste or $With). Since this is a regular expression to be used in $Paste/$With, there is no value in the user specifying a static pattern, because that static string can just be defined in $Paste/$With. The value in the $Copy parameter comes when a generic pattern is defined eg \d{3} (is non Literal), specifies any 3 digits as opposed to say '123', which could be used directly in the $Paste/$With parameter without the need for $Copy. The match defined by $Copy is stored in special variable ${_c} and can be referenced as such from $Paste and $With.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="dg"> <maml:name>Diagnose</maml:name> <maml:description> <maml:para>switch parameter that indicates the command should be run in WhatIf mode. When enabled it presents additional information that assists the user in correcting the un-expected results caused by an incorrect/un-intended regular expression. The current diagnosis will show the contents of named capture groups that they may have specified. When an item is not renamed (usually because of an incorrect regular expression), the user can use the diagnostics along side the 'Not Renamed' reason to track down errors. When $Diagnose has been specified, $WhatIf does not need to be specified.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="d"> <maml:name>Directory</maml:name> <maml:description> <maml:para>switch to indicate only Directory items in the pipeline will be processed. If neither this switch or the File switch are specified, then both File and Directory items are processed.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="x"> <maml:name>Except</maml:name> <maml:description> <maml:para>Regular expression string applied to the original pipeline item's name (before the $Pattern match has been removed). Allows the user to exclude some items that have been fed in via the pipeline. Those items that match the exclusion are skipped during the rename batch.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="f"> <maml:name>File</maml:name> <maml:description> <maml:para>switch to indicate only File items in the pipeline will be processed. If neither this switch or the Directory switch are specified, then both File and Directory items are processed.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="i"> <maml:name>Include</maml:name> <maml:description> <maml:para>Regular expression string applied to the original pipeline item's name (before the $Pattern match has been removed). Allows the user to include some items that have been fed in via the pipeline. Only those items that match $Include pattern are included during the rename batch, the others are skipped. The value of the Include parameter comes when you want to define a pattern which pipeline items match, without it be removed from the original name, which is what happens with $Pattern. Eg, the user may want to specify the only items that should be considered a candidate to be renamed are those that match a particular pattern but doing so in $Pattern would simply remove that pattern. That may be ok, but if it's not, the user should specify a pattern in the $Include and use $Pattern for the match you do want to be moved (with Anchor/Start/End) or replaced (with $With/$Paste).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="pr"> <maml:name>Prepend</maml:name> <maml:description> <maml:para>Prefixes a literal string to start of items name</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Test</maml:name> <maml:description> <maml:para>Required for unit tests only.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="t"> <maml:name>Top</maml:name> <maml:description> <maml:para>A number indicating how many items to process. If it is known that the number of items that will be candidates to be renamed is large, the user can limit this to the first $Top number of items. This is typically used as an exploratory tool, to determine the effects of the rename operation.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type> <maml:name>Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wh"> <maml:name>Whole</maml:name> <maml:description> <maml:para>Provides an alternative way to indicate that the regular expression parameters should be treated as a whole word (it just wraps the expression inside \b tokens). If set to '*', then it applies to all expression parameters otherwise a single letter can specify which of the parameters 'Whole' should be applied to. Valid values are:</maml:para> <maml:para>* 'p': $Pattern</maml:para> <maml:para>* 'a': $Anchor/AnchorEnd/AnchorStart</maml:para> <maml:para>* 'c': $Copy</maml:para> <maml:para>* 'i': $Include</maml:para> <maml:para>* 'x': $Except ' ': All the above (NB: Currently, can't be set to more than 1 of the above items at a time)</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">p</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">a</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">c</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">i</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">x</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">u</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">*</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>underscore</maml:name> <maml:description> <maml:para>The pipeline item which should either be an instance of FileInfo or DirectoryInfo.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">FileSystemInfo</command:parameterValue> <dev:type> <maml:name>FileSystemInfo</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Rename-Many</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Condition</maml:name> <maml:description> <maml:para>Provides another way of filtering pipeline items. This is not typically specified on the command line, rather it is meant for those wanting to build functionality on top of Rename-Many.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue> <dev:type> <maml:name>ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Context</maml:name> <maml:description> <maml:para>Provides another way of customising Rename-Many. This is not typically specified on the command line, rather it is meant for those wanting to build functionality on top of Rename-Many. $Context should be a PSCustomObject with the following note properties:</maml:para> <maml:para>* Title (default: 'Rename') the name used in the batch header.</maml:para> <maml:para>* ItemMessage (default: 'Rename Item') the operation name used for each renamed item.</maml:para> <maml:para>* SummaryMessage (default: 'Rename Summary') the name used in the batch summary.</maml:para> <maml:para>* Locked (default: 'REXFS_REMY_LOCKED) the name of the environment variable which controls</maml:para> <maml:para>the locking of the command. * DisabledEnVar (default: 'REXFS_REMY_UNDO_DISABLED') the name of the environment variable which controls if the undo script feature is disabled. * UndoDisabledEnVar (default: 'REXFS_REMY_UNDO_DISABLED') the name of the environment variable which determines if the Undo feature is disabled. This allows any other function built on top of Rename-Many to control the undo feature for itself independently of Rename-Many.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue> <dev:type> <maml:name>PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Cut</maml:name> <maml:description> <maml:para>Is a replacement for the Pattern parameter, when a Cut operation is required. The matched items will be removed from the item's name, and no other replacement occurs.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="dg"> <maml:name>Diagnose</maml:name> <maml:description> <maml:para>switch parameter that indicates the command should be run in WhatIf mode. When enabled it presents additional information that assists the user in correcting the un-expected results caused by an incorrect/un-intended regular expression. The current diagnosis will show the contents of named capture groups that they may have specified. When an item is not renamed (usually because of an incorrect regular expression), the user can use the diagnostics along side the 'Not Renamed' reason to track down errors. When $Diagnose has been specified, $WhatIf does not need to be specified.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="d"> <maml:name>Directory</maml:name> <maml:description> <maml:para>switch to indicate only Directory items in the pipeline will be processed. If neither this switch or the File switch are specified, then both File and Directory items are processed.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="x"> <maml:name>Except</maml:name> <maml:description> <maml:para>Regular expression string applied to the original pipeline item's name (before the $Pattern match has been removed). Allows the user to exclude some items that have been fed in via the pipeline. Those items that match the exclusion are skipped during the rename batch.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="f"> <maml:name>File</maml:name> <maml:description> <maml:para>switch to indicate only File items in the pipeline will be processed. If neither this switch or the Directory switch are specified, then both File and Directory items are processed.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="i"> <maml:name>Include</maml:name> <maml:description> <maml:para>Regular expression string applied to the original pipeline item's name (before the $Pattern match has been removed). Allows the user to include some items that have been fed in via the pipeline. Only those items that match $Include pattern are included during the rename batch, the others are skipped. The value of the Include parameter comes when you want to define a pattern which pipeline items match, without it be removed from the original name, which is what happens with $Pattern. Eg, the user may want to specify the only items that should be considered a candidate to be renamed are those that match a particular pattern but doing so in $Pattern would simply remove that pattern. That may be ok, but if it's not, the user should specify a pattern in the $Include and use $Pattern for the match you do want to be moved (with Anchor/Start/End) or replaced (with $With/$Paste).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Test</maml:name> <maml:description> <maml:para>Required for unit tests only.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="t"> <maml:name>Top</maml:name> <maml:description> <maml:para>A number indicating how many items to process. If it is known that the number of items that will be candidates to be renamed is large, the user can limit this to the first $Top number of items. This is typically used as an exploratory tool, to determine the effects of the rename operation.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type> <maml:name>Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wh"> <maml:name>Whole</maml:name> <maml:description> <maml:para>Provides an alternative way to indicate that the regular expression parameters should be treated as a whole word (it just wraps the expression inside \b tokens). If set to '*', then it applies to all expression parameters otherwise a single letter can specify which of the parameters 'Whole' should be applied to. Valid values are:</maml:para> <maml:para>* 'p': $Pattern</maml:para> <maml:para>* 'a': $Anchor/AnchorEnd/AnchorStart</maml:para> <maml:para>* 'c': $Copy</maml:para> <maml:para>* 'i': $Include</maml:para> <maml:para>* 'x': $Except ' ': All the above (NB: Currently, can't be set to more than 1 of the above items at a time)</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">p</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">a</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">c</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">i</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">x</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">u</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">*</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>underscore</maml:name> <maml:description> <maml:para>The pipeline item which should either be an instance of FileInfo or DirectoryInfo.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">FileSystemInfo</command:parameterValue> <dev:type> <maml:name>FileSystemInfo</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Rename-Many</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="p"> <maml:name>Pattern</maml:name> <maml:description> <maml:para>Regular expression string that indicates which part of the pipeline items' name that either needs to be moved or replaced as part of bulk rename operation. Those characters in the name which match are removed from the name.</maml:para> <maml:para>The pattern can be followed by an occurrence indicator. As the $Pattern parameter is strictly speaking an array, the user can specify the occurrence after the regular expression eg:</maml:para> <maml:para> $Pattern '(?<code>\w\d{2})', l</maml:para> <maml:para> => This indicates that the last match should be captured into named group 'code'.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Condition</maml:name> <maml:description> <maml:para>Provides another way of filtering pipeline items. This is not typically specified on the command line, rather it is meant for those wanting to build functionality on top of Rename-Many.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue> <dev:type> <maml:name>ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Context</maml:name> <maml:description> <maml:para>Provides another way of customising Rename-Many. This is not typically specified on the command line, rather it is meant for those wanting to build functionality on top of Rename-Many. $Context should be a PSCustomObject with the following note properties:</maml:para> <maml:para>* Title (default: 'Rename') the name used in the batch header.</maml:para> <maml:para>* ItemMessage (default: 'Rename Item') the operation name used for each renamed item.</maml:para> <maml:para>* SummaryMessage (default: 'Rename Summary') the name used in the batch summary.</maml:para> <maml:para>* Locked (default: 'REXFS_REMY_LOCKED) the name of the environment variable which controls</maml:para> <maml:para>the locking of the command. * DisabledEnVar (default: 'REXFS_REMY_UNDO_DISABLED') the name of the environment variable which controls if the undo script feature is disabled. * UndoDisabledEnVar (default: 'REXFS_REMY_UNDO_DISABLED') the name of the environment variable which determines if the Undo feature is disabled. This allows any other function built on top of Rename-Many to control the undo feature for itself independently of Rename-Many.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue> <dev:type> <maml:name>PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="dg"> <maml:name>Diagnose</maml:name> <maml:description> <maml:para>switch parameter that indicates the command should be run in WhatIf mode. When enabled it presents additional information that assists the user in correcting the un-expected results caused by an incorrect/un-intended regular expression. The current diagnosis will show the contents of named capture groups that they may have specified. When an item is not renamed (usually because of an incorrect regular expression), the user can use the diagnostics along side the 'Not Renamed' reason to track down errors. When $Diagnose has been specified, $WhatIf does not need to be specified.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="d"> <maml:name>Directory</maml:name> <maml:description> <maml:para>switch to indicate only Directory items in the pipeline will be processed. If neither this switch or the File switch are specified, then both File and Directory items are processed.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="x"> <maml:name>Except</maml:name> <maml:description> <maml:para>Regular expression string applied to the original pipeline item's name (before the $Pattern match has been removed). Allows the user to exclude some items that have been fed in via the pipeline. Those items that match the exclusion are skipped during the rename batch.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="f"> <maml:name>File</maml:name> <maml:description> <maml:para>switch to indicate only File items in the pipeline will be processed. If neither this switch or the Directory switch are specified, then both File and Directory items are processed.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="i"> <maml:name>Include</maml:name> <maml:description> <maml:para>Regular expression string applied to the original pipeline item's name (before the $Pattern match has been removed). Allows the user to include some items that have been fed in via the pipeline. Only those items that match $Include pattern are included during the rename batch, the others are skipped. The value of the Include parameter comes when you want to define a pattern which pipeline items match, without it be removed from the original name, which is what happens with $Pattern. Eg, the user may want to specify the only items that should be considered a candidate to be renamed are those that match a particular pattern but doing so in $Pattern would simply remove that pattern. That may be ok, but if it's not, the user should specify a pattern in the $Include and use $Pattern for the match you do want to be moved (with Anchor/Start/End) or replaced (with $With/$Paste).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Test</maml:name> <maml:description> <maml:para>Required for unit tests only.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="t"> <maml:name>Top</maml:name> <maml:description> <maml:para>A number indicating how many items to process. If it is known that the number of items that will be candidates to be renamed is large, the user can limit this to the first $Top number of items. This is typically used as an exploratory tool, to determine the effects of the rename operation.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type> <maml:name>Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Transform</maml:name> <maml:description> <maml:para>A script block which is given the chance to perform a modification to the finally named item. The transform is invoked prior to post-processing, so that the post-processing rules are not breached and the transform does not have to worry about breaking them. The transform function's signature is as follows:</maml:para> <maml:para>* Original: original item's name</maml:para> <maml:para>* Renamed: new name</maml:para> <maml:para>* CapturedPattern: pattern capture</maml:para> <maml:para></maml:para> <maml:para>and should return the new name. If the transform does not change the name, it should return an empty string.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue> <dev:type> <maml:name>ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wh"> <maml:name>Whole</maml:name> <maml:description> <maml:para>Provides an alternative way to indicate that the regular expression parameters should be treated as a whole word (it just wraps the expression inside \b tokens). If set to '*', then it applies to all expression parameters otherwise a single letter can specify which of the parameters 'Whole' should be applied to. Valid values are:</maml:para> <maml:para>* 'p': $Pattern</maml:para> <maml:para>* 'a': $Anchor/AnchorEnd/AnchorStart</maml:para> <maml:para>* 'c': $Copy</maml:para> <maml:para>* 'i': $Include</maml:para> <maml:para>* 'x': $Except ' ': All the above (NB: Currently, can't be set to more than 1 of the above items at a time)</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">p</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">a</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">c</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">i</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">x</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">u</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">*</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>underscore</maml:name> <maml:description> <maml:para>The pipeline item which should either be an instance of FileInfo or DirectoryInfo.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">FileSystemInfo</command:parameterValue> <dev:type> <maml:name>FileSystemInfo</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="a"> <maml:name>Anchor</maml:name> <maml:description> <maml:para>Indicates that the rename operation will be a move of the token from its original point to the point indicated by Anchor. Anchor is a regular expression string applied to the pipeline item's name (after the $Pattern match has been removed). The $Pattern match that is removed is inserted at the position indicated by the anchor match in collaboration with the $Relation parameter.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="ae"> <maml:name>AnchorEnd</maml:name> <maml:description> <maml:para>Similar to Anchor except that if the pattern specified by AnchorEnd does not match, then the Pattern match will be moved to the End. This is known as a Hybrid Anchor.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="as"> <maml:name>AnchorStart</maml:name> <maml:description> <maml:para>Similar to Anchor except that if the pattern specified by AnchorEnd does not match, then the Pattern match will be moved to the Start. This is known as a Hybrid Anchor.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="ap"> <maml:name>Append</maml:name> <maml:description> <maml:para>Appends a literal string to end of items name</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Condition</maml:name> <maml:description> <maml:para>Provides another way of filtering pipeline items. This is not typically specified on the command line, rather it is meant for those wanting to build functionality on top of Rename-Many.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue> <dev:type> <maml:name>ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Context</maml:name> <maml:description> <maml:para>Provides another way of customising Rename-Many. This is not typically specified on the command line, rather it is meant for those wanting to build functionality on top of Rename-Many. $Context should be a PSCustomObject with the following note properties:</maml:para> <maml:para>* Title (default: 'Rename') the name used in the batch header.</maml:para> <maml:para>* ItemMessage (default: 'Rename Item') the operation name used for each renamed item.</maml:para> <maml:para>* SummaryMessage (default: 'Rename Summary') the name used in the batch summary.</maml:para> <maml:para>* Locked (default: 'REXFS_REMY_LOCKED) the name of the environment variable which controls</maml:para> <maml:para>the locking of the command. * DisabledEnVar (default: 'REXFS_REMY_UNDO_DISABLED') the name of the environment variable which controls if the undo script feature is disabled. * UndoDisabledEnVar (default: 'REXFS_REMY_UNDO_DISABLED') the name of the environment variable which determines if the Undo feature is disabled. This allows any other function built on top of Rename-Many to control the undo feature for itself independently of Rename-Many.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSObject</command:parameterValue> <dev:type> <maml:name>PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="co"> <maml:name>Copy</maml:name> <maml:description> <maml:para>Regular expression string applied to the pipeline item's name (after the $Pattern match has been removed), indicating a portion which should be copied and re-inserted (via the $Paste parameter; see $Paste or $With). Since this is a regular expression to be used in $Paste/$With, there is no value in the user specifying a static pattern, because that static string can just be defined in $Paste/$With. The value in the $Copy parameter comes when a generic pattern is defined eg \d{3} (is non Literal), specifies any 3 digits as opposed to say '123', which could be used directly in the $Paste/$With parameter without the need for $Copy. The match defined by $Copy is stored in special variable ${_c} and can be referenced as such from $Paste and $With.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Cut</maml:name> <maml:description> <maml:para>Is a replacement for the Pattern parameter, when a Cut operation is required. The matched items will be removed from the item's name, and no other replacement occurs.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="dg"> <maml:name>Diagnose</maml:name> <maml:description> <maml:para>switch parameter that indicates the command should be run in WhatIf mode. When enabled it presents additional information that assists the user in correcting the un-expected results caused by an incorrect/un-intended regular expression. The current diagnosis will show the contents of named capture groups that they may have specified. When an item is not renamed (usually because of an incorrect regular expression), the user can use the diagnostics along side the 'Not Renamed' reason to track down errors. When $Diagnose has been specified, $WhatIf does not need to be specified.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="d"> <maml:name>Directory</maml:name> <maml:description> <maml:para>switch to indicate only Directory items in the pipeline will be processed. If neither this switch or the File switch are specified, then both File and Directory items are processed.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="dr"> <maml:name>Drop</maml:name> <maml:description> <maml:para>A string parameter (only applicable to move operations, ie Anchor/Star/End/hybrid) that defines what text is used to replace the Pattern match. So in this use-case, the user wants to move a particular token/pattern to another part of the name and at the same time drop a static string in the place where the $Pattern was removed from.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="e"> <maml:name>End</maml:name> <maml:description> <maml:para>Is another type of anchor used instead of $Anchor and specifies that the $Pattern match should be moved to the end of the new name.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="x"> <maml:name>Except</maml:name> <maml:description> <maml:para>Regular expression string applied to the original pipeline item's name (before the $Pattern match has been removed). Allows the user to exclude some items that have been fed in via the pipeline. Those items that match the exclusion are skipped during the rename batch.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="f"> <maml:name>File</maml:name> <maml:description> <maml:para>switch to indicate only File items in the pipeline will be processed. If neither this switch or the Directory switch are specified, then both File and Directory items are processed.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="i"> <maml:name>Include</maml:name> <maml:description> <maml:para>Regular expression string applied to the original pipeline item's name (before the $Pattern match has been removed). Allows the user to include some items that have been fed in via the pipeline. Only those items that match $Include pattern are included during the rename batch, the others are skipped. The value of the Include parameter comes when you want to define a pattern which pipeline items match, without it be removed from the original name, which is what happens with $Pattern. Eg, the user may want to specify the only items that should be considered a candidate to be renamed are those that match a particular pattern but doing so in $Pattern would simply remove that pattern. That may be ok, but if it's not, the user should specify a pattern in the $Include and use $Pattern for the match you do want to be moved (with Anchor/Start/End) or replaced (with $With/$Paste).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="ps"> <maml:name>Paste</maml:name> <maml:description> <maml:para>Formatter parameter for Update operations. Can contain named/numbered group references defined inside regular expression parameters, or use special named references $0 for the whole Pattern match and ${_c} for the whole Copy match.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="p"> <maml:name>Pattern</maml:name> <maml:description> <maml:para>Regular expression string that indicates which part of the pipeline items' name that either needs to be moved or replaced as part of bulk rename operation. Those characters in the name which match are removed from the name.</maml:para> <maml:para>The pattern can be followed by an occurrence indicator. As the $Pattern parameter is strictly speaking an array, the user can specify the occurrence after the regular expression eg:</maml:para> <maml:para> $Pattern '(?<code>\w\d{2})', l</maml:para> <maml:para> => This indicates that the last match should be captured into named group 'code'.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Array</command:parameterValue> <dev:type> <maml:name>Array</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="pr"> <maml:name>Prepend</maml:name> <maml:description> <maml:para>Prefixes a literal string to start of items name</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="r"> <maml:name>Relation</maml:name> <maml:description> <maml:para>Used in conjunction with the $Anchor parameter and can be set to either 'before' or 'after' (the default). Defines the relationship of the $pattern match with the $Anchor match in the new name for the pipeline item.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="s"> <maml:name>Start</maml:name> <maml:description> <maml:para>Is another type of anchor used instead of $Anchor and specifies that the $Pattern match should be moved to the start of the new name.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Test</maml:name> <maml:description> <maml:para>Required for unit tests only.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="t"> <maml:name>Top</maml:name> <maml:description> <maml:para>A number indicating how many items to process. If it is known that the number of items that will be candidates to be renamed is large, the user can limit this to the first $Top number of items. This is typically used as an exploratory tool, to determine the effects of the rename operation.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type> <maml:name>Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Transform</maml:name> <maml:description> <maml:para>A script block which is given the chance to perform a modification to the finally named item. The transform is invoked prior to post-processing, so that the post-processing rules are not breached and the transform does not have to worry about breaking them. The transform function's signature is as follows:</maml:para> <maml:para>* Original: original item's name</maml:para> <maml:para>* Renamed: new name</maml:para> <maml:para>* CapturedPattern: pattern capture</maml:para> <maml:para></maml:para> <maml:para>and should return the new name. If the transform does not change the name, it should return an empty string.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue> <dev:type> <maml:name>ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wh"> <maml:name>Whole</maml:name> <maml:description> <maml:para>Provides an alternative way to indicate that the regular expression parameters should be treated as a whole word (it just wraps the expression inside \b tokens). If set to '*', then it applies to all expression parameters otherwise a single letter can specify which of the parameters 'Whole' should be applied to. Valid values are:</maml:para> <maml:para>* 'p': $Pattern</maml:para> <maml:para>* 'a': $Anchor/AnchorEnd/AnchorStart</maml:para> <maml:para>* 'c': $Copy</maml:para> <maml:para>* 'i': $Include</maml:para> <maml:para>* 'x': $Except ' ': All the above (NB: Currently, can't be set to more than 1 of the above items at a time)</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="w"> <maml:name>With</maml:name> <maml:description> <maml:para>This is a NON regular expression string. It would be more accurately described as a formatter, similar to the $Paste parameter. Defines what text is used as the replacement for the $Pattern match. Works in concert with $Relation (whereas $Paste does not). $With can reference special variables:</maml:para> <maml:para>* $0: the pattern match</maml:para> <maml:para>* ${_a}: the anchor match</maml:para> <maml:para>* ${_c}: the copy match</maml:para> <maml:para></maml:para> <maml:para>When $Pattern contains named capture groups, these variables can also be referenced. Eg if the $Pattern is defined as '(?<day>\d{1,2})-(?<mon>\d{1,2})-(?<year>\d{4})', then the variables ${day}, ${mon} and ${year} also become available for use in $With or $Paste. Typically, $With is static text which is used to replace the $Pattern match and is inserted according to the Anchor match, (or indeed $Start or $End) and $Relation. When using $With, whatever is defined in the $Anchor match is not removed from the pipeline's name (this is different to how $Paste works).</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>underscore</maml:name> <maml:description> <maml:para>The pipeline item which should either be an instance of FileInfo or DirectoryInfo.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">FileSystemInfo</command:parameterValue> <dev:type> <maml:name>FileSystemInfo</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.IO.FileSystemInfo</maml:name> </dev:type> <maml:description> <maml:para>Parameter `$underscore`, can be DirectoryInfo instance or FileInfo instance.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Object</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>----------------------- EXAMPLE 1 (Move) -----------------------</maml:title> <dev:code>gci ... | Rename-Many -File -Pattern 'data' -Anchor 'loopz' -Relation 'before'</dev:code> <dev:remarks> <maml:para>Move a static string before anchor (consider file items only)</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------------------- EXAMPLE 2 (Move) -----------------------</maml:title> <dev:code>gci ... | Rename-Many -Pattern 'data',l -Anchor 'loopz' -Relation 'before' -Whole p</dev:code> <dev:remarks> <maml:para>Move last occurrence of whole-word static string before anchor</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------------------- EXAMPLE 3 (Move) -----------------------</maml:title> <dev:code>gci ... | Rename-Many -Directory -Pattern 'data' -Anchor 'loopz' -Relation 'before' -Drop '-'</dev:code> <dev:remarks> <maml:para>Move a static string before anchor and drop (consider Directory items only)</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------------------- EXAMPLE 4 (Move) -----------------------</maml:title> <dev:code>gci ... | Rename-Many -Directory -Pattern 'data' -AnchorEnd 'loopz' -Relation 'before' -Drop '-'</dev:code> <dev:remarks> <maml:para>Move a static string before anchor and drop (consider Directory items only), if anchor does not match, move the pattern match to end.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------------------- EXAMPLE 5 (Move) -----------------------</maml:title> <dev:code>gci ... | Rename-Many -Directory -Pattern 'data' -Start -Drop '-'</dev:code> <dev:remarks> <maml:para>Move a static string to start and drop (consider Directory items only)</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------------------- EXAMPLE 6 (Move) -----------------------</maml:title> <dev:code>gci ... | Rename-Many -Pattern '\d{2}-data' -Anchor 'loopz' -Relation 'before'</dev:code> <dev:remarks> <maml:para>Move a match before anchor</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------------------- EXAMPLE 7 (Move) -----------------------</maml:title> <dev:code>gci ... | Rename-Many -Pattern '\d{2}-data',l -Anchor 'loopz' -Relation 'before' -Whole p</dev:code> <dev:remarks> <maml:para>Move last occurrence of whole-word static string before anchor.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------------------- EXAMPLE 8 (Move) -----------------------</maml:title> <dev:code>gci ... | Rename-Many -Pattern '\d{2}-data' -Anchor 'loopz' -Relation 'before' -Drop '-'</dev:code> <dev:remarks> <maml:para>Move a match before anchor and drop</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------------------- EXAMPLE 9 (Update) ----------------------</maml:title> <dev:code>gci ... | Rename-Many -Pattern 'data',l -Whole p -Paste '_info_'</dev:code> <dev:remarks> <maml:para>Update last occurrence of whole-word static string using $Paste.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------------------- EXAMPLE 10 (Update) ---------------------</maml:title> <dev:code>gci ... | Rename-Many -Pattern 'data' -Paste '_info_'</dev:code> <dev:remarks> <maml:para>Update a static string using $Paste</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------------------- EXAMPLE 11 (Update) ---------------------</maml:title> <dev:code>gci ... | Rename-Many -Pattern '\d{2}-data', l -Paste '${_a}_info_'</dev:code> <dev:remarks> <maml:para>Update 2nd occurrence of whole-word match using $Paste and preserve anchor</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------------------- EXAMPLE 12 (Update) ---------------------</maml:title> <dev:code>gci ... | Rename-Many -Pattern (?<day>\d{2})-(?<mon>\d{2})-(?<year>\d{2}) -Paste '(${year})-(${mon})-(${day}) ${_a}'</dev:code> <dev:remarks> <maml:para>Update match contain named capture group using $Paste and preserve the anchor</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------------------- EXAMPLE 13 (Update) ---------------------</maml:title> <dev:code>gci ... | Rename-Many -Pattern (?<day>\d{2})-(?<mon>\d{2})-(?<year>\d{2}) -Copy '[A-Z]{3}',l -Whole c -Paste 'CCY_${_c} (${year})-(${mon})-(${day}) ${_a}'</dev:code> <dev:remarks> <maml:para>Update match contain named capture group using $Paste and preserve the anchor and copy whole last occurrence</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------------------- EXAMPLE 14 (Cut) -----------------------</maml:title> <dev:code>gci ... | Rename-Many -Cut 'data'</dev:code> <dev:remarks> <maml:para>Cut a literal token</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------------------- EXAMPLE 15 (Cut) -----------------------</maml:title> <dev:code>gci ... | Rename-Many -Cut, l 'data'</dev:code> <dev:remarks> <maml:para>Cut last occurrence of literal token</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------------------- EXAMPLE 16 (Cut) -----------------------</maml:title> <dev:code>gci ... | Rename-Many -Cut, 2 '\d{2}'</dev:code> <dev:remarks> <maml:para>Cut the second 2 digit sequence</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------------------- EXAMPLE 17 (Prepend) ---------------------</maml:title> <dev:code>gci ... | Rename-Many -Prepend 'begin_'</dev:code> <dev:remarks> <maml:para>Prefix items with fixed token</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------------------- EXAMPLE 18 (Append) ---------------------</maml:title> <dev:code>gci ... | Rename-Many -Append '_end'</dev:code> <dev:remarks> <maml:para>Append fixed token to items</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Elizium.RexFs</maml:linkText> <maml:uri>https://github.com/EliziumNet/RexFs</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Test-IsAlreadyAnchoredAt</command:name> <command:verb>Test</command:verb> <command:noun>IsAlreadyAnchoredAt</command:noun> <maml:description> <maml:para>Checks to see if a given pattern is matched at the start or end of an input string.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>When Rename-Many uses the Start or End switches to move a match to the corresponding location, it needs to filter out those entries where the specified occurrence of the Pattern is already at the desire location. We can't do this using a synthetic anchored regex using ^ and $, rather we must use the origin regex, perform the match and then see where that match resides, by consulting the index and length of that match instance.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Test-IsAlreadyAnchoredAt</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Source</maml:name> <maml:description> <maml:para>The input source</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Expression</maml:name> <maml:description> <maml:para>A regex instance to match against</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>Occurrence</maml:name> <maml:description> <maml:para>Which match occurrence in Expression do we want to check</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>End</maml:name> <maml:description> <maml:para>Check match is at the end of the input source</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Start</maml:name> <maml:description> <maml:para>Check match is at the start of the input source</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>End</maml:name> <maml:description> <maml:para>Check match is at the end of the input source</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Expression</maml:name> <maml:description> <maml:para>A regex instance to match against</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>Occurrence</maml:name> <maml:description> <maml:para>Which match occurrence in Expression do we want to check</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Source</maml:name> <maml:description> <maml:para>The input source</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Start</maml:name> <maml:description> <maml:para>Check match is at the start of the input source</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Boolean</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>[string]$source = 'ABCDEA'; [regex]$reg = 'A'; Test-IsAlreadyAnchoredAt -Source $source -Start -Expression $reg -Occurrence 'f';</dev:code> <dev:remarks> <maml:para>Requested occurrence 'A' IS already at start of the source string 'ABCDEA', will return true.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Elizium.RexFs</maml:linkText> <maml:uri>https://github.com/EliziumNet/RexFs</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Update-Match</command:name> <command:verb>Update</command:verb> <command:noun>Match</command:noun> <maml:description> <maml:para>The core update match action function principally used by Rename-Many. Updates $Pattern match in it's current location.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Returns a new string that reflects updating the specified $Pattern match. Firstly, Update-Match removes the Pattern match from $Value. This makes the Paste and Copy match against the remainder ($patternRemoved) of $Value. This way, there is no overlap between the Pattern match and $Paste and it also makes the functionality more understandable for the user. NB: Pattern only tells you what to remove, but it's the Copy and Paste that defines what to insert.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Update-Match</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Value</maml:name> <maml:description> <maml:para>The source value against which regular expressions are applied.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Pattern</maml:name> <maml:description> <maml:para>Regular expression string that indicates which part of the $Value that either needs to be moved or replaced as part of overall rename operation. Those characters in $Value which match $Pattern, are removed.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Copy</maml:name> <maml:description> <maml:para>Regular expression string applied to $Value (after the $Pattern match has been removed), indicating a portion which should be copied and re-inserted (via the $Paste parameter; see $Paste). Since this is a regular expression to be used in $Paste, there is no value in the user specifying a static pattern, because that static string can just be defined in $Paste. The value in the $Copy parameter comes when a non literal pattern is defined eg \d{3} (is non literal), specifies any 3 digits as opposed to say '123', which could be used directly in the $Paste parameter without the need for $Copy. The match defined by $Copy is stored in special variable ${_c} and can be referenced as such from $Paste.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CopyOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l</maml:para> <maml:para>* f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Diagnose</maml:name> <maml:description> <maml:para>switch parameter that indicates the command should be run in WhatIf mode. When enabled it presents additional information that assists the user in correcting the un-expected results caused by an incorrect/un-intended regular expression. The current diagnosis will show the contents of named capture groups that they may have specified. When an item is not renamed (usually because of an incorrect regular expression), the user can use the diagnostics along side the 'Not Renamed' reason to track down errors. When $Diagnose has been specified, $WhatIf does not need to be specified.</maml:para> </maml:description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Paste</maml:name> <maml:description> <maml:para>Formatter parameter for Update operations. Can contain named/numbered group references defined inside regular expression parameters, or use special named references $0 for the whole Pattern match and ${_c} for the whole Copy match. The Paste can also contain named/numbered group references defined in $Pattern.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PatternOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l</maml:para> <maml:para>* f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Copy</maml:name> <maml:description> <maml:para>Regular expression string applied to $Value (after the $Pattern match has been removed), indicating a portion which should be copied and re-inserted (via the $Paste parameter; see $Paste). Since this is a regular expression to be used in $Paste, there is no value in the user specifying a static pattern, because that static string can just be defined in $Paste. The value in the $Copy parameter comes when a non literal pattern is defined eg \d{3} (is non literal), specifies any 3 digits as opposed to say '123', which could be used directly in the $Paste parameter without the need for $Copy. The match defined by $Copy is stored in special variable ${_c} and can be referenced as such from $Paste.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CopyOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l</maml:para> <maml:para>* f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Diagnose</maml:name> <maml:description> <maml:para>switch parameter that indicates the command should be run in WhatIf mode. When enabled it presents additional information that assists the user in correcting the un-expected results caused by an incorrect/un-intended regular expression. The current diagnosis will show the contents of named capture groups that they may have specified. When an item is not renamed (usually because of an incorrect regular expression), the user can use the diagnostics along side the 'Not Renamed' reason to track down errors. When $Diagnose has been specified, $WhatIf does not need to be specified.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Paste</maml:name> <maml:description> <maml:para>Formatter parameter for Update operations. Can contain named/numbered group references defined inside regular expression parameters, or use special named references $0 for the whole Pattern match and ${_c} for the whole Copy match. The Paste can also contain named/numbered group references defined in $Pattern.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Pattern</maml:name> <maml:description> <maml:para>Regular expression string that indicates which part of the $Value that either needs to be moved or replaced as part of overall rename operation. Those characters in $Value which match $Pattern, are removed.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Regex</command:parameterValue> <dev:type> <maml:name>Regex</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PatternOccurrence</maml:name> <maml:description> <maml:para>Can be a number or the letters f, l</maml:para> <maml:para>* f: first occurrence</maml:para> <maml:para>* l: last occurrence</maml:para> <maml:para>* <number>: the nth occurrence</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Value</maml:name> <maml:description> <maml:para>The source value against which regular expressions are applied.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> <dev:code>Update-Match 'VAL 1999-02-21 + RH - CLOSE' '(?\<dt\>\d{4}-\d{2}-\d{2})' -Paste '----X--X--'</dev:code> <dev:remarks> <maml:para>Update with literal content</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title> <dev:code>[string]$today = Get-Date -Format 'yyyy-MM-dd' Update-Match 'VAL 1999-02-21 + RH - CLOSE' '(?\<dt\>\d{4}-\d{2}-\d{2})' -Paste $('_(' + $today + ')_')</dev:code> <dev:remarks> <maml:para>Update with variable content</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- EXAMPLE 3 --------------------------</maml:title> <dev:code>Update-Match 'VAL 1999-02-21 + RH - CLOSE' '(?\<dt\>\d{4}-\d{2}-\d{2})' -Paste '${_c},----X--X--' -Copy '[^\s]+'</dev:code> <dev:remarks> <maml:para>Update with whole copy reference</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- EXAMPLE 4 --------------------------</maml:title> <dev:code>Update-Match 'VAL 1999-02-21 + RH - CLOSE' '(?\<dt\>\d{4}-\d{2}-\d{2})' -Paste '${first},----X--X--' -Copy '(?<first>[^\s]+)'</dev:code> <dev:remarks> <maml:para>Update with group references</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- EXAMPLE 5 --------------------------</maml:title> <dev:code>Update-Match 'VAL 1999-02-21 + RH - CLOSE' '(?\<dt\>\d{4}-\d{2}-\d{2})' -Paste '${_c},----X--X--' -Copy '[^\s]+' -CopyOccurrence 2</dev:code> <dev:remarks> <maml:para>Update with 2nd copy occurrence</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Elizium.RexFs</maml:linkText> <maml:uri>https://github.com/EliziumNet/RexFs</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> </helpItems> |