title: What is the PowerShell Equivilant of `curl -L https://unpkg.com/@pnpm/self-installer | node`?
body: <p>I'm using <a href="https://docs.gitlab.com/ee/ci/README.html" rel="nofollow noreferrer">GitLab.com</a> with a Windows OS runner, so we commonly use PowerShell in place of Bash for scripting steps in the console. I'm trying to use <a href="https://pnpm.js.org/docs/en/continuous-integration.html" rel="nofollow noreferrer">pnpm</a> and the examples they give suggest the following</p>
  <pre><code>$ curl -L https://unpkg.com/@pnpm/self-installer | node
  $ install pnpm
  </code></pre>
  <p>What's the PowerShell version of the above curl requests piped into <code>node</code>?</p>
  <p>I've been trying both <a href="https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Invoke-RestMethod?view=powershell-6" rel="nofollow noreferrer">Invoke-RestMethod</a> and using the <code>curl</code> alias from within PowerShell, like</p>
  <pre><code>PS&gt; curl https://unpkg.com/@pnpm/self-installer | node
  </code></pre>
  <p>but have been getting</p>
  <blockquote>
  <p>SyntaxError: Invalid or unexpected token</p>
  </blockquote>
  <p>Also from the curl docs, I know <a href="https://curl.haxx.se/docs/manpage.html#-L" rel="nofollow noreferrer">--location</a> is needed.</p>