Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PS C:\Windows\system32> $username = 'auto'
- PS C:\Windows\system32> $password = 'd724e072946e544fed850f1d5f74f988'
- PS C:\Windows\system32> $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $usern
- ame,$password)))
- PS C:\Windows\system32> # http://stackoverflow.com/questions/24672760/powershells-invoke-restmethod-equivalent-of-curl-u
- -basic-authentication
- PS C:\Windows\system32>
- PS C:\Windows\system32> Invoke-RestMethod -Method POST -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} -Uri h
- ttp://p00toldscpul01/jenkins/job/testRemote/build
- PS C:\Windows\system32> Invoke-RestMethod -Method POST -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} -Uri h
- ttp://p00toldscpul01/jenkins/job/testRemote/build
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement