Skip to content

Instantly share code, notes, and snippets.

@HauptJ
Last active November 8, 2017 04:44
Show Gist options
  • Save HauptJ/c6302b13f752e6ab89ba1931e6708c5b to your computer and use it in GitHub Desktop.
Save HauptJ/c6302b13f752e6ab89ba1931e6708c5b to your computer and use it in GitHub Desktop.
Simple Power-Shell script to download Virtualbox, Vagrant and github desktop or Git
############################################################
# Powershell script to download installers for DevOps Vagrant Environment
# Downloads Virtualbox 5.2, Vagrant 2.0.1 64 bit, and github desktop OR git 64 bit
# Author: Joshua Haupt josh@hauptj.com Date: 7.11.2017
############################################################
Write-Host 'Making "DevEnv" folder in Downloads'
cd ~\Downloads\
mkdir DevEnv
Write-Host 'Starting downloads in "DevEnv"'
cd DevEnv
# Download Virtualbox 5.2
Write-Host "Downloading Virtualbox 5.2"
Invoke-WebRequest -OutFile virtualbox.exe http://download.virtualbox.org/virtualbox/5.2.0/VirtualBox-5.2.0-118431-Win.exe
# Use TLS web requests from now on.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# Download Vagrant 2.0.1 64 bit
Write-Host "Downloading Vagrant 2.0.1 64 bit"
Invoke-WebRequest -OutFile vagrant.exe https://releases.hashicorp.com/vagrant/2.0.1/vagrant_2.0.1_x86_64.msi
# Prompt user to download either github desktop or git 64 bit
$option = Read-Host -Prompt 'Enter "github" for github desktop or "git" for git 64 bit"'
If($option -eq 'github'){
Write-Host "Downloading github desktop"
Invoke-WebRequest -OutFile github.exe https://central.github.com/deployments/desktop/desktop/latest/win32
} ElseIf($option -eq 'git') {
Write-Host "Downloading git 64 bit"
Invoke-WebRequest -OutFile git.exe https://github.com/git-for-windows/git/releases/download/v2.15.0.windows.1/Git-2.15.0-64-bit.exe
} Else {
Write-Host "Invalid input, defaulting to github desktop"
Write-Host "Downloading github desktop"
Invoke-WebRequest -OutFile github.exe https://central.github.com/deployments/desktop/desktop/latest/win32
}
# Open Explorer in "DevEnv" folder
Write-Host 'Opening "DevEnv" folder'
Write-Host "IMPORTANT: Install the programs in this order 1.) Virtualbox 2.) Vagrant, 3.) Github or Git"
ii .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment