Skip to content

Webcrape latest version #4246

Discussion options

You must be logged in to vote
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$uri = "https://api.github.com/repos/git-for-windows/git/releases/latest"
$webresponse = Invoke-WebRequest -UseBasicParsing $uri
$Json = $webresponse | ConvertFrom-Json
$download =  $Json.assets.browser_download_url -like '*Git-*-64-bit.exe'
Start-BitsTransfer -Source $($download[0]) -Description $($json.name) -Destination ".\GitInstaller.exe"
Start-Process -FilePath ".\GitInstaller.exe" -ArgumentList "/SP- /VERYSILENT /SUPPRESSMSGBOXES /ALLUSERS /NORESTART /FORCECLOSEAPPLICATIONS /LOG=$env:TEMP\GitInstall.log" -Wait
& 'C:\Program Files\Git\cmd\git.exe' lfs install

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@MichaelKlinteberg
Comment options

Comment options

You must be logged in to vote
1 reply
@MichaelKlinteberg
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by MichaelKlinteberg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants