Created
February 4, 2019 19:13
-
-
Save guitarrapc/f630b05bbf26e9a60dab883c684d38c5 to your computer and use it in GitHub Desktop.
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
$ErrorActionPreference = 'Stop' | |
$toolsPath = Split-Path $MyInvocation.MyCommand.Definition | |
. $toolsPath\helpers.ps1 | |
$pp = Get-PackageParameters | |
Set-InstallerRegistrySettings $pp | |
Stop-GitSSHAgent | |
$packageArgs = @{ | |
PackageName = 'git.install' | |
FileType = 'exe' | |
SoftwareName = 'Git version *' | |
File = Get-Item $toolsPath\*-32-bit.exe | |
File64 = Get-Item $toolsPath\*-64-bit.exe | |
SilentArgs = "/VERYSILENT", "/SUPPRESSMSGBOXES", "/NORESTART", "/NOCANCEL", "/SP-", "/LOG", (Get-InstallComponents $pp) | |
} | |
Install-ChocolateyInstallPackage @packageArgs | |
$packageName = $packageArgs.packageName | |
$installLocation = Get-AppInstallLocation $packageArgs.SoftwareName | |
if (!$installLocation) { Write-Warning "Can't find $packageName install location"; return } | |
Write-Host "$packageName installed to '$installLocation'" | |
Get-ChildItem $toolsPath\*.exe | ForEach-Object { Remove-Item $_ -ea 0; if (Test-Path $_) { Set-Content "$_.ignore" '' } } | |
if ($pp.NoCredentialManager) { | |
Write-Host "Git credential manager will be disabled." | |
Install-ChocolateyEnvironmentVariable GCM_VALIDATE 'false' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment