title: Escaping arguments when passing %* from batch script as $args to powershell script
body: <p>I have a batch script that takes any number of arguments (list of files) and executes a powershell script with the following command structure:</p>
  
  <p><code>"%POWERSHELL%" -Command "%SCRIPT%" %*</code></p>
  
  <p><code>%POWERSHELL%</code> is the path to <code>PowerShell.exe</code>, and <code>%SCRIPT%</code> is my powershell script that interprets that receives <code>%*</code> as <code>$args</code>. The problem is that if I pass in something like the filename <code>test$file.name</code>, PowerShell receives <code>test.name</code>, presumably because <code>$file</code> is interpreted as an empty variable.</p>
  
  <p>Is there a good way to escape each argument with single quotes or backticks from the batch script, or otherwise deal with this?</p>