Download Files From Github Without Git Using Powershell
Have you ever needed to download code or a repository from Github, but didn’t want to download and install Git on a machine, create an SSH key, etc. If so, I have something that you may like.
You can find the entire function here: https://github.com/MSAdministrator/GetGithubRepository
To use this function, you will need to know the path to the Github repository (of course) you want to download. Once you have that URL, you will need to pass each piece of the URL into a parameter on the function.
For example, let’s take a URL like https: //github.com/MSAdministrator/WriteLogEntry. This URL can be broken down as follows
- MSAdministrator = Owner
- WriteLogEntry = Repository
- Branch = Master (unless you want a different branch)
- FilePath = (Files and paths you want to download)
To use this function, you will need to pass the following values as parameters to the function. For example, to download my WriteLogEntry repository you will need to call the function like so:
Get-GithubRepository -Owner MSAdministrator -Repository WriteLogEntry -Verbose -FilePath `
‘WriteLogEntry.psm1’,
‘WriteLogEntry.psd1’,
‘Public’,
’en-US’,
’en-US\about_WriteLogEntry.help.txt’,
‘Public\Write-LogEntry.ps1’
I hope that this function helps some of you who want to quickly download a Github repository without installing or using Git. If you have issues or like this function, please submit issues or fork requests to my Github.
Enjoy!
Original Image here: