Is it possible to download file from Github Wiki in Powershell?

Viewed 134

I am working in private repository that has Wiki pages with zip files that was pushed to Wiki only not to main repo. So now I'm trying to arrange a Powershell script that download zip file from this Wiki.

I followed the script at: StackeOverflow: PowerShell to download Zip file from GitHub API and everywhere else but always, always get this 404 Not found error when Invoke-WebRequest try to actually download file.

I have a direct link to zip file: https://github.com/enterprise/repo/wiki/Folder/file.zip (I assure you this link download file from any web browser without any hiccups. From Chrome it always succeed)

but whatever credentials I enter or whatever I change the download link to - it always fails with 404 Not Found error. In Chrome browser 'Network' tab I see that it does redirect to https://raw.githubusercontent.com/wiki/enterprise/repo/Folder/file.zip?token=ASZER2VYQDOVBN46TXVK2BWTU3 but it does not happened in Powershell script (?)

I really appreciate a small example of Powershell script for private repo.

Thank you !

0 Answers
Related