Skip to content

Instantly share code, notes, and snippets.

@gravity00
Last active June 20, 2024 10:40
Show Gist options
  • Select an option

  • Save gravity00/22f0e4fd3a544a2bdbd2c693bb4a9f50 to your computer and use it in GitHub Desktop.

Select an option

Save gravity00/22f0e4fd3a544a2bdbd2c693bb4a9f50 to your computer and use it in GitHub Desktop.
Clean developer machine setup using Chocolatey
$ErrorActionPreference = "Stop"
Set-ExecutionPolicy Bypass -Scope Process -Force;
## Install Chocolatey
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
## Install packages
# Web
choco install googlechrome -y
if (!$?) { Write-Error "Failed to install Google Chrome" }
choco install firefox -y
if (!$?) { Write-Error "Failed to install Firefox" }
# Utilitary
choco install 7zip.install -y
if (!$?) { Write-Error "Failed to install 7-Zip" }
choco install adobereader -y
if (!$?) { Write-Error "Failed to install Adobe Acrobat Reader" }
choco install paint.net -y
if (!$?) { Write-Error "Failed to install Paint.NET" }
# Frameworks
choco install jdk9 -y
if (!$?) { Write-Error "Failed to install Java JDK 9" }
choco install dotnet4.7.1 -y
if ($LASTEXITCODE -ne 0 -and $LASTEXITCODE -ne 3010) { Write-Error "Failed to install .NET Framework 4.7.1" }
choco install dotnetcore-sdk -y
if ($LASTEXITCODE -ne 0 -and $LASTEXITCODE -ne 3010) { Write-Error "Failed to install .NET Core SDK" }
choco install git.install -y
if (!$?) { Write-Error "Failed to install Git" }
choco install nodejs.install --version 8.9.1 -y
if (!$?) { Write-Error "Failed to install NodesJs" }
# IDE
choco install notepadplusplus.install -y
if (!$?) { Write-Error "Failed to install Notepad++" }
choco install visualstudiocode -y
if (!$?) { Write-Error "Failed to install VS Code" }
choco install visualstudio2017enterprise -y
if ($LASTEXITCODE -ne 0 -and $LASTEXITCODE -ne 3010) { Write-Error "Failed to install VS 2017" }
## Configuration
# IIS
Enable-WindowsOptionalFeature -Online -FeatureName IIS-StaticContent -All -NoRestart
Enable-WindowsOptionalFeature -Online -FeatureName IIS-DefaultDocument -All -NoRestart
Enable-WindowsOptionalFeature -Online -FeatureName IIS-DirectoryBrowsing -All -NoRestart
Enable-WindowsOptionalFeature -Online -FeatureName IIS-StaticContent -All -NoRestart
Enable-WindowsOptionalFeature -Online -FeatureName IIS-AspNet -All -NoRestart
Enable-WindowsOptionalFeature -Online -FeatureName IIS-AspNet45 -All -NoRestart
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ISAPIFilter -All -NoRestart
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpCompressionStatic -All -NoRestart
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ManagementConsole -All -NoRestart
refreshenv
# NPM
npm install npm-windows-upgrade -g
if (!$?) { Write-Error "Failed to install npm upgrade tool" }
npm-windows-upgrade.cmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment