Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. PS C:\Windows\system32> $username = 'auto'
  2. PS C:\Windows\system32> $password = 'd724e072946e544fed850f1d5f74f988'
  3. PS C:\Windows\system32> $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $usern
  4. ame,$password)))
  5. PS C:\Windows\system32> # http://stackoverflow.com/questions/24672760/powershells-invoke-restmethod-equivalent-of-curl-u
  6. -basic-authentication
  7. PS C:\Windows\system32>
  8. PS C:\Windows\system32> Invoke-RestMethod -Method POST -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} -Uri h
  9. ttp://p00toldscpul01/jenkins/job/testRemote/build
  10.  
  11. PS C:\Windows\system32> Invoke-RestMethod -Method POST -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} -Uri h
  12. ttp://p00toldscpul01/jenkins/job/testRemote/build
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement