install-gitscm.ps1


<#PSScriptInfo
 
.VERSION 1.0
 
.GUID 18015469-b4ee-408d-a9ce-9cb165e04224
 
.AUTHOR Karsten.Bott@labbuildr.com
 
.COMPANYNAME
 
.COPYRIGHT
 
.TAGS
 
.LICENSEURI
 
.PROJECTURI
 
.ICONURI
 
.EXTERNALMODULEDEPENDENCIES
 
.REQUIREDSCRIPTS
 
.EXTERNALSCRIPTDEPENDENCIES
 
.RELEASENOTES
 
 
#>


<#
 
.DESCRIPTION
 This script is used during unsattended installs, eg, azure stack post deploy,
it in stalls GIT SCM and add�s the Path to the Current PS Session
 
#>
 
Param()
if (!$Downloadlocation)
    {
    $Downloadlocation = $env:TEMP
    }
$GIT_Base_URL ="https://git-scm.com/download/win"
$Req = Invoke-WebRequest -UseBasicParsing -Uri $GIT_Base_URL
$DownloadLink =  ($req.Links | where outerhtml -match "64-bit Git for Windows Setup").href
$file = split-path -Leaf $DownloadLink
$Outfile = Join-Path $Downloadlocation $file
Invoke-WebRequest  $DownloadLink -OutFile $Outfile
Unblock-File $Outfile
Start-Process (join-path $Downloadlocation $file) -ArgumentList "/SILENT" -Wait
##
$env:Path += ";C:\Program Files\Git\cmd"