title: How to pass a parameter with parentheses to Powershell from command line?
body: <p>I have a Powershell script called <code>MSSQLStartStopServices.ps1</code> used to stop some SQL Server services. This script is being called using a third-party vendor software. The parameters in question are <code>Fully qualified instance name</code> and <code>Start|Stop</code></p>
  
  <p>e.g.</p>
  
  <pre><code>MSSQLStartStopServices.ps1 HOSTNAME\INSTANCENAME Start
  </code></pre>
  
  <p>For a default instance, the software passes (local) as the INSTANCENAME. </p>
  
  <pre><code>MSSQLStartStopServices.ps1 HOSTNAME\(local) Start
  </code></pre>
  
  <p>But when I run this I get an error from Powershell:</p>
  
  <blockquote>
    <p>The term 'local' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.</p>
  </blockquote>
  
  <p>When I try and put the instance name in quotes it works fine in a Powershell window:</p>
  
  <pre><code>MSSQLStartStopServices.ps1 "HOSTNAME\(local)" Start
  </code></pre>
  
  <p>However the third party software calls Powershell from the commandline first, like so:</p>
  
  <pre><code>powershell .\MSSQLStartStopServices.ps1 "HOSTNAME\(local)" Start
  </code></pre>
  
  <p>This causes the same error as if the quotes were not there.</p>
  
  <p><strong>How do I work around this issue?</strong></p>