Skip to content

Instantly share code, notes, and snippets.

@andrefcdias
Last active April 15, 2022 05:46
Show Gist options
  • Save andrefcdias/e1435ae4458024ece36a3b93e3cdd24f to your computer and use it in GitHub Desktop.
Save andrefcdias/e1435ae4458024ece36a3b93e3cdd24f to your computer and use it in GitHub Desktop.
#Requires -RunAsAdministrator
<# Coolest development environment setup script in the block
---------------------------------------------------------
Before running the script:
Make sure to run `Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process`
before running the script in an admin Powershell session.
See more at https:/go.microsoft.com/fwlink/?LinkID=135170.
This script will also set the Execution Policy to Unrestricted
so it can run part 2 of the script after the reboot.
What can I expect from this script?
This will install basic dev stuff like:
- PowerToys
- Visual Studio Code
- Activate WSL feature
#>
function hello() {
echo ""
Write-Host -ForegroundColor White "Welcome to the coolest development environment setup script!"
echo ""
echo "Please make sure you don't have any work pending saving."
echo "This script will need to restart your computer due to WSL/Hyper-V feature activations."
echo ""
pause
echo ""
}
function install() {
echo ""
echo "# Installing helpful development apps"
echo ""
echo "> Installing PowerToys..."
winget install "Microsoft.PowerToys" --accept-package-agreements --accept-source-agreements
echo "> PowerToys installed!"
echo ""
echo "> Installing Powershell Core..."
winget install "Microsoft.PowerShell" --accept-package-agreements --accept-source-agreements
echo "> Powershell Core installed!"
echo "> Closing that pesky PowerToys window that opens after installation 😡"
Get-Process | Where-Object {$_.ProcessName -eq "PowerToys"} | Stop-Process
echo ""
echo "> Installing Visual Studio Code..."
winget install "vscode" --accept-package-agreements --accept-source-agreements
echo "> Visual Studio Code installed!"
echo ""
echo "> Installing WSL..."
wsl --install
echo ""
echo "TODO: Pending automatic restart and resuming of configuration, please run the second script manually"
}
hello
install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment