Powershell Trigger Gitlab CI With Variables

You can trigger with PowerShell GitLab-CI project with the below code.

Token and Ref must be filled.

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$Body = @{
"variables[variable1]" = "key"
"variables[variable2]" = "key"
"variables[variable3]" = "key"
"token" = "token"
"ref" = "branchref"
}
Invoke-RestMethod -Method Post -Uri "https://gitlab.example.com/api/v4/projects/id/trigger/pipeline" -Body $Body

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x