Created
September 13, 2018 16:58
-
-
Save onyxhat/d32a47dec8effe3aae44db9f5e3100d6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[string]$UserName = "myJenkinsUser" | |
[string]$Jenkins_Token = "myJenkinsUserApiKey" | |
[uri]$Build_URL = "http://jenkins.local/job/myAwesomeApp/latest/" | |
$Headers = @{ | |
"Authorization" = "Basic " + [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("${UserName}:${Jenkins_Token}")) | |
} | |
$jobObj = Invoke-RestMethod -Headers $Headers -Uri "${Build_URL}/api/json" | |
$jobObj |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment