Last active
January 22, 2024 04:08
-
-
Save gabriel-vanca/4641547b35f69f5079a400ac305d3924 to your computer and use it in GitHub Desktop.
Quick Clone Github repository
This file contains 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
$repoDownloadLocalPath = "$env:Temp\WinGet" | |
#Ensure download folder is empty | |
if(Test-Path -path $repoDownloadLocalPath) | |
{ | |
Remove-Item $repoDownloadLocalPath -Recurse -Force | |
} | |
$repoUrl = "https://github.com/gabriel-vanca/WinGet" | |
git clone $repoUrl $repoDownloadLocalPath --depth 1 --progress -v | |
Get-ChildItem $repoDownloadLocalPath -Recurse | Unblock-File | |
# Optional | |
$gitRepoPath = $repoDownloadLocalPath + "\.git" | |
Remove-Item $gitRepoPath -Recurse -Force | |
# Do actions | |
# ... | |
# Delete | |
if(Test-Path -path $repoDownloadLocalPath) | |
{ | |
Remove-Item $repoDownloadLocalPath -Recurse -Force | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment