Skip to content

Instantly share code, notes, and snippets.

@guitarrapc
Created February 4, 2019 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guitarrapc/f630b05bbf26e9a60dab883c684d38c5 to your computer and use it in GitHub Desktop.
Save guitarrapc/f630b05bbf26e9a60dab883c684d38c5 to your computer and use it in GitHub Desktop.
$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