title: Powershell -Command InvokeSqlcmd + Incorrect Synatx error
body: <p>I'm trying to restore RDS DB using the InvokeSQL command and there is a use case to explicitly call pwsh!</p>
  <p>The below works a gem</p>
  <p>Invoke-Sqlcmd -Query 'exec msdb.dbo.rds_restore_database @s3_arn_to_restore_from=&quot;arn:aws:s3:::XXX/XX/XXX.bak&quot;,@restore_db_name=mydatabase' -ServerInstance XXXXX.eu-west-1.rds.amazonaws.com -Database master -Username XXX -Password XXX</p>
  <p>But I have a problem while executing it as pwsh -command</p>
  <p>pwsh -Command &quot;&amp; {Invoke-Sqlcmd -Query 'exec msdb.dbo.rds_restore_database @s3_arn_to_restore_from=&quot;arn:aws:s3:::XXX/XX/XXX.bak&quot;,@restore_db_name=mydatabase' -ServerInstance XXXXX.eu-west-1.rds.amazonaws.com -Database master -Username XXX -Password XXX}&quot;</p>
  <p>The error I get is a syntax issue-</p>
  <p>pwsh : [91mInvoke-Sqlcmd: [91mIncorrect syntax near 'arn:'.
  At line:1 char:1</p>
  <ul>
  <li>pwsh -Command &quot;&amp; {Invoke-Sqlcmd -Query 'exec msdb.dbo.rds_restore_dat ...</li>
  <li>
  <pre><code>  + CategoryInfo          : NotSpecified: ([91mInvoke-Sql...x near 'arn:'. :String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
  
  </code></pre>
  </li>
  </ul>