Does anyone know if it's possible to convert the curl
command used to trigger builds in Gitlab-CI to a Powershell equivalent using Invoke-RestMethod
?
Example curl
command:
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
This was taken from Gitlab's documentation page.
I found quite a few postings about converting a curl
script for Powershell but I haven't had any luck in getting it to work. Here are some of the links I referenced:
- How to send multipart/form-data with PowerShell Invoke-RestMethod
- PowerShell equivalent of curl
- Running curl via powershell - how to construct arguments?
Any help would be appreciated.