Skip to content

Instantly share code, notes, and snippets.

@hoetz
Last active March 27, 2018 18:22
Show Gist options
  • Save hoetz/b6e0f6f24fbfa251cd5c to your computer and use it in GitHub Desktop.
Save hoetz/b6e0f6f24fbfa251cd5c to your computer and use it in GitHub Desktop.
Github auth token with powershell
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("USERNAME:PASSWORD")))
Invoke-RestMethod -Uri "https://api.github.com/authorizations" -method post -ContentType "application/json" -Body "{""scopes"" : ""gist"",""note"":""VSCode-Gist-Extension""}" -Headers @{"Authorization"="Basic $base64AuthInfo"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment