Skip to content

Instantly share code, notes, and snippets.

@trulysinclair
Last active June 28, 2019 03:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trulysinclair/6fa7fd9bc8a1ebf6b4bfacc68de7b508 to your computer and use it in GitHub Desktop.
Save trulysinclair/6fa7fd9bc8a1ebf6b4bfacc68de7b508 to your computer and use it in GitHub Desktop.
Automated Windows 10 fresh install
# =====================================================================
# Copyright 2019 - Present TheGrimSilence
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =====================================================================
# ATTENTION: If you're reading this, understand I learned about Powershell Scripting
# and put this script together in a handful of hours. If you would like to help
# refine this script, feel free to do so.
#Requires -RunAsAdministrator
# Install Chocolately, which will allow us to install other software.
Write-Output "Installing Chocolately"
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Install our desired software packages, each with their own parameters for installation.
Write-Output "Installing Software Packages"
Write-Output "Installing packages this may take a moment..."
# Git: Version control for your source code.
choco install git.install --params '/GitAndUnixToolsOnPath /NoAutoCrlf' -y
# Visual Studio Code: The go-to code editor for the frontend.
choco install vscode --params /NoDesktopIcon -y
# GitHub Desktop: A Git-based GUI.
choco install github-desktop
# Node.js: Serverside JavaScript.
choco install nodejs-lts -y
# Yarn: Facebook's answer to NPM' bullshit.
choco install yarn -y
# Google Chome: Simply, better.
choco install googlechrome
# Here we just go through and individually install each of our basic extensions.
# Keep in mind we don't autoconfigure these for the user, we jsut install them.
[Boolean]$codeSuccessfullyInstalled = code --version
[String[]]$extensions = @(
# Better Comments: Highlights special comments.
"aaron-bond.better-comments",
# GitHub Markdown Preview: GitHub styled Markdown, Emoji support, Checkboxes, and YAML Frontmatter.
"bierner.github-markdown-preview",
# GitLens: More Git information embedded into your worklfow.
"eamodio.gitlens",
# Material Icon Theme: Adds Material Design icons, replacing VS Code's native icons.
"pkief.material-icon-theme",
# Path Intellisense: Gives more insight when typing paths.
"christian-kohler.path-intellisense",
# Prettier - Code Formatter: Automatically styles your code as you type, or save.
"esbenp.prettier-vscode",
# TSLint: TypeScript linter.
"ms-vscode.vscode-typescript-tslint-plugin"
)
# We need to refresh our environment variables before we install our vscode extensions.
if (refreshenv) {
refreshenv
}
# If Visual Studio Code is installed, we can go ahead and install extensions.
if ($codeSuccessfullyInstalled) {
foreach ($ext in $extensions) {
try {
code --install-extension $ext
}
catch {
"Something happened"
}
}
}
else {
Write-Output "Visual Studio Code is not installed. Install VS Code, and try again."
}
Write-Output "All done! Exiting in 5 seconds..."
Start-Sleep -Seconds 5
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment