Created
April 20, 2016 00:16
-
-
Save a5ync/5d7233caa14de6c6fc7ec96d515470b5 to your computer and use it in GitHub Desktop.
Download a lightweight Github .git-less snapshot (zipball) of a particular branch
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= "password" | |
#zipballs of particular branches have syntax /repository-name/zipball/branch-name | |
$branchname = "master" | |
$linkToSnapshot = "https://github.com/a5ync/webgl/zipball/"+$branchname | |
#prepare credential header | |
$pair = "$($user):$($pass)" | |
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair)) | |
$basicAuthValue = "Basic $encodedCreds" | |
$Headers = @{ | |
Authorization = $basicAuthValue | |
} | |
Write-Host "Downloading snapshot" | |
Invoke-WebRequest -Uri $linkToSnapshot -Headers $Headers -OutFile 'snapshot.zip' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment