Skip to content

Instantly share code, notes, and snippets.

@Dragod
Created October 29, 2021 18:09
Show Gist options
  • Save Dragod/86a8bb914438a694cbadb6a71ace7da8 to your computer and use it in GitHub Desktop.
Save Dragod/86a8bb914438a694cbadb6a71ace7da8 to your computer and use it in GitHub Desktop.
Design-machine-installer
# Description: Screendragon Design install for new machine or new VM boot
# Author: Paniconi Fabio
# Last update: 29/10/2021
# Install Chocolatey, required to run the rest of the scripts
Write-Output "`r"
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Write-Output "`r"
#ensure installing powershell modules don't prompt on needed dependencies
$ConfirmPreference = "None"
function Success
{
process { Write-Host $_ -ForegroundColor Green }
}
function Alert
{
process { Write-Host $_ -ForegroundColor Red }
}
function Warning
{
process { Write-Host $_ -ForegroundColor Yellow }
}
$sw = [Diagnostics.Stopwatch]::StartNew()
#--- Setting up Windows ---
#--- Editors ---
choco install -y vscode
choco install -y sublimetext3
#--- Terminal ---
choco install -y microsoft-windows-terminal
#--- Git ---
choco install -y git
choco install -y github-desktop
#--- Nodejs ---
choco install -y nodejs-lts
#--- VPN Tunnel ---
choco install -y openvpn
#--- Build Tools for Msbuild ---
choco install -y visualstudio2019buildtools
choco install -y visualstudio2019-workload-webbuildtools
choco install -y visualstudio2019-workload-manageddesktopbuildtools
choco install -y nuget.commandline
choco install -y iisexpress
choco install -y Firefox
#--- Legacy: foundation, breakpoint and compass from Ruby ---
choco install -y ruby
#--- Common chat & meeting ---
choco install -y microsoft-teams
#--- Initialize env var and run gems & node packages ---
# Create pesistent env variable for Openvpn and git, require Powershell restart to work
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\OpenVPN\bin;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\tools\ruby30\bin", "Machine")
# Create session env variable to install on the fly ruby gems and needed node global packages.
$env:Path += ";C:\Program Files\nodejs\"
$env:Path += ";C:\tools\ruby30\bin"
#--- Refresh Environment Variables ---
RefreshEnv.cmd
Write-Output "`r"
Write-Output "Installing Ruby gems." | Success
Write-Output "`r"
#--- Gem List ---
gem install breakpoint -v 2.7.1
gem install compass -v 1.0.3
gem install sass -v 3.4.25
gem install zurb-foundation -v 4.3.2
# Breakpoint install a version of sass witch do not work with compass
gem uninstall sass -v 3.7.4
Write-Output "`r"
Write-Output "Installing Node global packages." | Success
Write-Output "`r"
#--- Node global packages ---
# Grunt build
npm i grunt -g
# Node build
npm i svg2sprite -g
npm i svg2sprite-cli -g
#--- Refresh Environment Variables ---
RefreshEnv.cmd
Write-Output "`r"
Write-Output "Done installing all the packages." | Success
Write-Output "`r"
$sw.Stop()
Write-Host "Installer execution time in minutes:" $sw.Elapsed.TotalMinutes
Write-Output "`r"
Read-Host "Press any key to exit..."
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment