Advertisement
Guest User

Untitled

a guest
Aug 10th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. $username = "uname"
  2. $password = "pword"
  3.  
  4. $boundary = [guid]::NewGuid().ToString().Replace("-", "").Substring(0, 16)
  5. $enc = [System.Text.Encoding]::GetEncoding("utf-8")
  6. $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $username,$password)))
  7.  
  8. $headers = @{}
  9. $headers.Add("Host", "api.bitbucket.org")
  10. $headers.Add("Authorization", "Basic $base64AuthInfo")
  11.  
  12. $repoResult
  13. $repoResult = Invoke-WebRequest -Uri "https://bitbucket.org/teamAccount/repoName/get/master.zip" -Method GET -Verbose -OutFile .output.zip #-Method GET -Headers $headers -Verbose
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement