PowerShell : retrieve file from GitHub
问题 I need to download a file from my GitHub private repo. So following the instructions on the GitHub site, I created an OAuth token for my credentials. Then I executed this PS script : $WebClient = New-Object -TypeName System.Net.WebClient $WebClient.Headers.Add('Authorization','{OAuth token}') $uri = "https://github.com/mycompany/myrepo/blob/master/myfile.zip" $targetPath = "c:\temp" $WebClient.DownloadFile($uri, $targetPath) However, $WebClient.DownloadFile() returns a 404. This is strange