title: How do I include ampersands in a powershell command in a batch file?
body: <p>I am trying to download a Google sheet via a batch file. This works:</p>
  
  <pre><code>powershell -Command "Invoke-WebRequest https://docs.google.com/spreadsheets/d/SPREADSHEET_ID/export?exportFormat=tsv -OutFile output.tsv"
  </code></pre>
  
  <p>When I specify which sheet/tab I want by adding &amp;gid=1234, this breaks:</p>
  
  <pre><code>powershell -Command "Invoke-WebRequest https://docs.google.com/spreadsheets/d/SPREADSHEET_ID/export?exportFormat=tsv&amp;gid=1234 -OutFile output.tsv"
  </code></pre>
  
  <p>The error is:</p>
  
  <blockquote>
    <p>The ampersand (&amp;) character is not allowed. The &amp; operator is reserved
    for future use; wrap an ampersand in double quotation marks ("&amp;") to
    pass it as part of a string.</p>
  </blockquote>
  
  <p>How do I wrap the ampersand in quotes without breaking the outer quotes for the Command parameter?</p>