title: Convert Gitlab CI Trigger Curl to Powershell Invoke-RestMethod
body: <p>Does anyone know if it's possible to convert the <code>curl</code> command used to trigger builds in Gitlab-CI to a Powershell equivalent using <code>Invoke-RestMethod</code>?</p>
  
  <p>Example <code>curl</code> command:</p>
  
  <pre><code>curl --request POST \
    --form token=TOKEN \
    --form ref=master \
    --form "variables[UPLOAD_TO_S3]=true" \
    https://gitlab.example.com/api/v3/projects/9/trigger/builds
  </code></pre>
  
  <p>This was taken from Gitlab's <a href="http://docs.gitlab.com/ce/ci/triggers/README.html" rel="nofollow noreferrer">documentation</a> page.</p>
  
  <p>I found quite a few postings about converting a <code>curl</code> script for Powershell but I haven't had any luck in getting it to work. Here are some of the links I referenced:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/22491129/how-to-send-multipart-form-data-with-powershell-invoke-restmethod">How to send multipart/form-data with PowerShell Invoke-RestMethod</a></li>
  <li><a href="https://superuser.com/questions/344927/powershell-equivalent-of-curl">PowerShell equivalent of curl</a></li>
  <li><a href="https://stackoverflow.com/questions/30807318/running-curl-via-powershell-how-to-construct-arguments">Running curl via powershell - how to construct arguments?</a></li>
  </ul>
  
  <p>Any help would be appreciated.</p>