mirror of
https://github.com/kataras/iris.git
synced 2025-12-23 04:47:02 +00:00
nothing serious here yet, just having fun with powershell and my nerves - but it works
Former-commit-id: ec83062ab7a588e9bfc6c42ce59834abf24723fa
This commit is contained in:
40
_benchmarks/benchmarker/scripts/git-install.ps1
Normal file
40
_benchmarks/benchmarker/scripts/git-install.ps1
Normal file
@@ -0,0 +1,40 @@
|
||||
# borrowed: https://github.com/PowerShell/vscode-powershell/blob/develop/scripts/Install-VSCode.ps1
|
||||
# edited to support a custom install directory and fix an issue with ssl and
|
||||
# simplify the script - we don't need update only a temp installation.
|
||||
|
||||
param([string]$InstallDir="$env:TEMP")
|
||||
|
||||
If(!(test-path $InstallDir))
|
||||
{
|
||||
New-Item -ItemType Directory -Force -Path $InstallDir
|
||||
}
|
||||
|
||||
$filename=-join($InstallDir, "\", "git-installer.exe")
|
||||
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
|
||||
foreach ($asset in (Invoke-RestMethod https://api.github.com/repos/git-for-windows/git/releases/latest).assets) {
|
||||
if ($asset.name -match 'Git-\d*\.\d*\.\d*-64-bit\.exe') {
|
||||
$dlurl = $asset.browser_download_url
|
||||
$newver = $asset.name
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
Write-Host "`nDownloading latest stable git..." -ForegroundColor Yellow
|
||||
Remove-Item -Force $filename -ErrorAction SilentlyContinue
|
||||
Invoke-WebRequest -Uri $dlurl -OutFile $filename
|
||||
|
||||
Write-Host "`nInstalling git..." -ForegroundColor Yellow
|
||||
Start-Process -Wait $filename -ArgumentList /VERYSILENT, /DIR="$InstallDir", \FORCECLOSEAPPLICATIONS
|
||||
# or SILENT
|
||||
|
||||
Write-Host "`nInstallation complete!`n`n" -ForegroundColor Green
|
||||
}
|
||||
finally {
|
||||
$ProgressPreference = 'Continue'
|
||||
}
|
||||
|
||||
$s = get-process ssh-agent -ErrorAction SilentlyContinue
|
||||
if ($s) {$true}
|
||||
Reference in New Issue
Block a user