title: Rename multiple files with special characters in filenames
body: <p>Trying to remove the first few characters from a large number of files in the same directory, but having trouble with special characters in the filenames.  I also need to use a wildcard to specify what text to remove since that text may contain a one or two digit number.</p>
  
  <p>I'm a novice using v2.0.1.1.</p>
  
  <p>an example filename is </p>
  
  <pre><code>(2) S17- 22429 E1_[49946,12147]_composite_image.jpg
  </code></pre>
  
  <p>I need to remove the initial number in parenthesis along with the following space.  the number in parenthesis may be one or two digits, hence the need for a wildcard.</p>
  
  <p>Resulting filename should be:</p>
  
  <pre><code>S17- 22429 E1_[49946,12147]_composite_image.jpg
  </code></pre>
  
  <p>All files will contain coordinates separated by "," in square brackets, and all will be .jpg, but everything else in the final names names will vary.</p>
  
  <p>Been reading through various articles on bits and pieces of what is going wrong, have tried code below.</p>
  
  <p>Issue seems to be with square brackets and maybe the comma, but only techniques I can find (``[, etc.) tell you how to deal with them in the search string, not in the portion of the string you are uninterested in.  -literalpath does not seem to help, either.</p>
  
  <pre><code>dir | rename-item -NewName { ($_.name) -Replace("\(*\) ","")}
  </code></pre>
  
  <p>And have tried various alterations to this basic code.</p>
  
  <p>Runs through every file, but all with:</p>
  
  <pre><code>Rename-Item : Cannot rename because item at 'Microsoft.PowerShell.Core\FileSystem::C:\...\(2) S17- 22429 E1_[49946,12147]_composite_image.jpg' does not exist.
  At line:1 char:19
  + dir | rename-item &lt;&lt;&lt;&lt;  -NewName { ($_.name) -Replace("\(*\) ","")}
      + CategoryInfo          : InvalidOperation: (:) [Rename-Item], PSInvalidOperationException
      + FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.RenameItemCommand
  </code></pre>