Skip to content

Instantly share code, notes, and snippets.

@gabriel-vanca
Last active January 22, 2024 04:08
Show Gist options
  • Save gabriel-vanca/4641547b35f69f5079a400ac305d3924 to your computer and use it in GitHub Desktop.
Save gabriel-vanca/4641547b35f69f5079a400ac305d3924 to your computer and use it in GitHub Desktop.
Quick Clone Github repository
$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