Convert Gitlab CI Trigger Curl to Powershell Invoke-RestMethod
You can pass the token and the branch parameters directly in the URL. As for variables, putting it into the body variable should do the trick.
$Body = @{
"variables[UPLOAD_TO_S3]" = "true"
}
Invoke-RestMethod -Method Post -Uri "https://gitlab.example.com/api/v3/projects/9/trigger/builds?token=$Token&ref=$Ref" -Body $Body