Skip to content

Instantly share code, notes, and snippets.

@motowilliams
Created March 15, 2017 22:28
Show Gist options
  • Save motowilliams/7a6361e9d64bce9a876af3d4fd9b7b91 to your computer and use it in GitHub Desktop.
Save motowilliams/7a6361e9d64bce9a876af3d4fd9b7b91 to your computer and use it in GitHub Desktop.
$downloads = "C:\Downloads"
if(!(Test-Path $downloads\7za.exe)){
Write-Host "Creating $downloads Directory"
$directory = New-Item -ItemType Directory -Path $downloads
}
# we need something to handle this tarball since Windows natively can't
if(!(Test-Path "$downloads\7zip\7za.exe")){
Write-Host "Downloading 7-Zip"
$7zipInstallerUri = "http://www.7-zip.org/a/7za920.zip"
Invoke-WebRequest -Uri $7zipInstallerUri -OutFile "$downloads\7za.zip"
Expand-Archive $downloads\7za.zip -DestinationPath $downloads\7zip
Remove-Item -Force $downloads\7za.zip
Move-Item -Force $downloads\7zip\7za.exe $downloads
Remove-Item -Force -Recurse $downloads\7zip
}
# grab the latest installer - it would be nice to have a permalink to the latest
if(!(Test-Path "$downloads\TeamCity.tar.gz")){
Write-Host "Downloading TeamCity"
$teamCityInstallerUri = "https://download-cf.jetbrains.com/teamcity/TeamCity-10.0.5.tar.gz"
Invoke-WebRequest -Uri $teamCityInstallerUri -OutFile "$downloads\TeamCity.tar.gz"
}
Push-Location
Set-Location $downloads
Write-Host "Uncompressing TeamCity.tar.gz"
& $downloads\7za.exe x -y .\TeamCity.tar.gz
Write-Host "Unpacking TeamCity.tar"
& $downloads\7za.exe x -y .\TeamCity.tar
Remove-Item -Force $downloads\TeamCity.tar
Pop-Location
Move-Item -Path $downloads\TeamCity C:\
### aaaand now what?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment