Created
August 2, 2020 05:04
-
-
Save jcefoli/4f24620acc0521f895649c933ee6685b to your computer and use it in GitHub Desktop.
Authenticate with token to Download File from Raw Githubusercontent
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
$headers = @{'Accept' = 'application/json'} | |
$tokenString = "REPLACE-GITHUB-TOKEN-HERE" + ":x-oauth-basic" | |
$base64Auth = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(($tokenString))) | |
$headers.Add('Authorization',"Basic $base64Auth") | |
$content = Invoke-RestMethod -Uri "https://raw.githubusercontent.com/ORG/Repo/master/something.ps1" -Headers $headers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment