Created
May 20, 2015 22:05
-
-
Save IsaacCisneros/5ae6dde98ea09378df8d to your computer and use it in GitHub Desktop.
Basic Auth [PS | GitHub APIv3]
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
$user = 'user' | |
$pass = 'pass' | |
$pair = "$($user):$($pass)" | |
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair)) | |
$basicAuthValue = "Basic $encodedCreds" | |
$Headers = @{ | |
Authorization = $basicAuthValue | |
} | |
Invoke-WebRequest -Uri https://api.github.com/users/defunkt -Headers $Headers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment