title: Powershell - Unepxected Argument in SQL Script
body: <p>I am trying to compile a sql procedure script in a database that has some pattern/ string within enclosed in double quotes. I get an error when compiling this object using sqlcmd. This is the query I use in Powershell.</p>
  
  <pre><code>$query = [IO.File]::ReadAllText($_.FullName)
  $result = SQLCMD -S $FullDBServer -E -I -Q $query -d $Database 
  </code></pre>
  
  <p>this is the sql script I created to mimic my scenario. The value has to be stored with double quotes in the db.</p>
  
  <pre><code>SELECT '"hi"'
  </code></pre>
  
  <p>This is the error I see.</p>
  
  <pre><code>SQLCMD : Sqlcmd: 'hi"'
  + $result = SQLCMD -S $FullDBServer -E -I -Q $query -d $Database
  +           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  + CategoryInfo: NotSpecified: (Sqlcmd: 'hi"':String) [], RemoteException
  + FullyQualifiedErrorId : NativeCommandError
  " -d local': Unexpected argument. Enter '-?' for help.
  </code></pre>
  
  <p>I have tried replacing the query in ps with escape characters, here-string. Doesn't help. Any thoughts?</p>