Skip to content

Instantly share code, notes, and snippets.

@simonpo
Last active July 22, 2022 11:54
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save simonpo/838ba95a822c2e33a82d4b307ca190ac to your computer and use it in GitHub Desktop.
Save simonpo/838ba95a822c2e33a82d4b307ca190ac to your computer and use it in GitHub Desktop.
Windows 10 dev box setup with winget

Winget is a command line tool that allows discovery and installation of applications, which will eventually make its way to mainline Windows 10. As I set up a new machine every couple of weeks, it's handy to have a batch file to run from the command line and install a bunch of tools, utilities and languages I use all the time.

You can install the winget preview appx here, and there are more options described here if you want to go the Windows Insider route.

@echo off
Echo Install a bunch of useful things
REM Powertoys
winget install Microsoft.Powertoys
if %ERRORLEVEL% EQU 0 Echo Powertoys installed successfully. %ERRORLEVEL%
REM SharpKeys
winget install sharpkeys
if %ERRORLEVEL% EQU 0 Echo SharpKeys installed successfully. %ERRORLEVEL%
REM Teams
winget install -e Microsoft.Teams
if %ERRORLEVEL% EQU 0 Echo Teams installed successfully. %ERRORLEVEL%
REM Terminal
winget install -e Microsoft.WindowsTerminal
if %ERRORLEVEL% EQU 0 Echo Terminal installed successfully. %ERRORLEVEL%
REM 7Zip
winget install 7zip.7zip
if %ERRORLEVEL% EQU 0 Echo 7Zip installed successfully. %ERRORLEVEL%
REM PuTTY
winget install PuTTY.PuTTY
if %ERRORLEVEL% EQU 0 Echo PuTTY installed successfully. %ERRORLEVEL%
REM Git
winget install -e Git.Git
if %ERRORLEVEL% EQU 0 Echo Git installed successfully. %ERRORLEVEL%
REM Visual Studio Code
winget install -e Microsoft.VisualStudioCode
if %ERRORLEVEL% EQU 0 Echo VS Code installed successfully. %ERRORLEVEL%
REM Postman
winget install Postman.Postman
if %ERRORLEVEL% EQU 0 Echo Postman installed successfully. %ERRORLEVEL%
REM Node.js
winget install OpenJS.nodejs
if %ERRORLEVEL% EQU 0 Echo Node.js installed successfully. %ERRORLEVEL%
REM WhatsAoo
winget install WhatsApp.WhatsApp
if %ERRORLEVEL% EQU 0 Echo WhatsApp installed successfully. %ERRORLEVEL%
REM Ubuntu
winget install -e Canonical.Ubuntu
if %ERRORLEVEL% EQU 0 Echo Ubuntu installed successfully. %ERRORLEVEL%
REM Azure CLI, Storage Explorer
winget install Microsoft.AzureCLI
if %ERRORLEVEL% EQU 0 Echo AzureCLI installed successfully. %ERRORLEVEL%
winget install Microsoft.AzureStorageExplorer
if %ERRORLEVEL% EQU 0 Echo Azure Storage Explorer installed successfully. %ERRORLEVEL%
@psydvl
Copy link

psydvl commented May 30, 2021

Use powershell instead

(
    "Microsoft.Powertoys",
    "sharpkeys",
    "Microsoft.Teams",
    "Microsoft.WindowsTerminal",
    "7zip.7zip",
    "PuTTY.PuTTY",
    "Git.Git",
    "Microsoft.VisualStudioCode",
    "Postman.Postman",
    "OpenJS.nodejs",
    "WhatsApp.WhatsApp",
    "Canonical.Ubuntu",
    "Microsoft.AzureCLI",
    "Microsoft.AzureStorageExplorer"
) | foreach {
	if (winget install -e --id $_) {
		echo "Success on $_"
	} else {
		echo "Error on $_"
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment