title: Powershell invoke-webrequest downloading HTML not actual file
body: <p>I am trying to download a google spreadsheet via an <code>invoke-webrequest</code>in powershell.</p>
  
  <p>My link looks something like this and I can confirm that if I go to the link it prompts me to download the file I want...</p>
  
  <p><code>$url = https://docs.google.com/spreadsheets/d/XXXXXXXXXXXXXXXX/export?format=csv</code></p>
  
  <p>I have tried downloading the file via 2 ways:</p>
  
  <p><code>Invoke-WebRequest $url -OutFile $saveLocation</code></p>
  
  <p><code>(New-Object System.Net.WebClient).DownloadFile($url, $saveLocation)</code></p>
  
  <p>Both of these just download the HTML for the page, and not the actual file. </p>
  
  <p>The spreadsheet I am downloading is 100% public so it is not like I need to be logged into a google account to view it.</p>