-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-git.ps1
More file actions
43 lines (33 loc) · 1.03 KB
/
install-git.ps1
File metadata and controls
43 lines (33 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
$ErrorActionPreference = 'Stop'
. ./install-functions.ps1
$PackageFormat = 'Git-2.*64-bit.exe'
$LogFile = ".install-git.log.tmp"
# Invoke-WebRequest https://github.com/git-for-windows/git/releases/download/v2.36.1.windows.1/Git-2.36.1-64-bit.exe -OutFile Git-2.36.1-64-bit.exe
$PackageFile = Find-Install-Package-WIE -PackageFormat $PackageFormat
if (!($?))
{
exit 1
}
Write-Output "Installing $PackageFile"
# See the install folder in PowerShellOptions.inf
$Result = Start-Process -NoNewWindow -Wait -PassThru -FilePath "./$PackageFile" `
-ArgumentList `
"/LANG=en", `
"/ALLUSERS", `
"/VERYSILENT", `
"/NORESTART", `
"/NOCANCEL", `
"/SP-", `
"/SUPPRESSMSGBOXES", `
"/CLOSEAPPLICATIONS", `
"/RESTARTAPPLICATIONS", `
"/LOG=$LogFile", `
"/LOADINF=git-for-windows.inf"
Get-Content $LogFile
Remove-Item $LogFile
if ($Result.ExitCode -ne 0)
{
Write-Error "Installation failed. The exit code was $($Result.ExitCode)"
exit 1
}
Write-Output "$PackageFile was installed successfully"