title: Getting an Error when I try to change file name in PowerShell
body: <p>I found similar commands to these online. I want to replace the parenthesis in my file names to either a space or empty string.</p>
  
  <p>The files I'm trying to change look like the following:</p>
  
  <pre><code>Nehemiah (1).mp3
  Nehemiah (2).mp3
  Nehemiah (11).mp3
  </code></pre>
  
  <p>Really I'd like them too look like the following:</p>
  
  <pre><code>Nehemiah 01.mp3
  Nehemiah 02.mp3
  Nehemiah 11.mp3
  </code></pre>
  
  <p>Here are the scripts I've tried.</p>
  
  <pre><code>Dir | Rename-Item –NewName { $_.name –replace “(“,”” }
  Dir *.mp3 | rename-item -newname {  $_.name  -replace " ("," "  }
  </code></pre>
  
  <p>Neither of these work.</p>
  
  <p>Here is the error message I'm getting.</p>
  
  <blockquote>
    <p>Rename-Item : The input to the script block for parameter 'NewName'
    failed. The regular expression pattern  ( is not valid. At line:1
    char:34
    + Dir *.mp3 | rename-item -newname {  $_.name  -replace " ("," "  }
    +                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (C:\Users...ehemiah (1).mp3:PSObject) [Rename-Item], Parameter    ndingException
        + FullyQualifiedErrorId : ScriptBlockArgumentInvocationFailed,Microsoft.PowerShell.Commands.RenameItemCommand</p>
  </blockquote>