A comprehensive, automated Windows setup toolkit that streamlines the installation and configuration of development tools, applications, and VS Code extensions for a new Windows machine.
This project automates the tedious process of setting up a Windows development environment by:
- Installing essential development tools via package managers (WinGet, Chocolatey)
- Configuring fonts for better coding experience
- Setting up VS Code with pre-selected extensions
- Enabling WSL2 for Linux development workflows
- Providing robust error handling to ensure reliable installations
- Offering easy customization through JSON configuration
Perfect for developers who frequently set up new Windows machines, onboard team members, or want a consistent development environment across multiple systems.
- Windows 10 (version 1903 or higher) or Windows 11
- PowerShell 5.1 or higher (comes with Windows)
- Administrator privileges (scripts will prompt for elevation)
- Internet connection for downloading packages
- Windows Package Manager (WinGet) - Will be prompted for installation if not present
- Visual Studio Code - Required only if running
vs-code.ps1
# Clone the repository
git clone https://github.com/your-username/windows-setup.git
cd windows-setup
# Or download and extract the ZIP file# Open PowerShell as Administrator
# Navigate to the project directory
.\apps.ps1# After VS Code is installed
.\vs-code.ps1# Enable Windows Subsystem for Linux
.\wsl.ps1windows-setup/
βββ README.md # This documentation
βββ config.json # Package configuration file
βββ apps.ps1 # Main application installer
βββ vs-code.ps1 # VS Code extensions installer
βββ wsl.ps1 # WSL2 setup script
βββ productkey.vbs # Windows product key utility
The heart of this setup is the config.json file, which defines what gets installed. This approach separates configuration from logic, making it easy to customize without modifying scripts.
{
"chocolatey": {
"clis": ["nuget.commandline", "webpi"],
"fonts": ["lato", "opensans", "sourcecodepro"],
"apps": ["youtube-dl"]
},
"winget": [
"Git.Git",
"Python.Python.3.12",
"Microsoft.VisualStudioCode",
"Docker.DockerDesktop"
],
"vscode_extensions": [
"ms-python.python",
"ms-vscode.powershell",
"eamodio.gitlens"
]
}For WinGet packages:
- Find the package ID using:
winget search "package name" - Add the exact ID to the
wingetarray inconfig.json
"winget": [
"Microsoft.PowerToys",
"Notepad++.Notepad++",
"Your.NewPackage.ID"
]For Chocolatey packages:
- Find the package name at chocolatey.org
- Add to the appropriate section (
clis,fonts, orapps)
"chocolatey": {
"apps": ["vlc", "7zip", "your-new-package"]
}For VS Code extensions:
- Find the extension ID in VS Code marketplace URL or using:
code --list-extensions - Add to the
vscode_extensionsarray
"vscode_extensions": [
"ms-python.python",
"your.extension.id"
]Simply delete the package name/ID from the relevant array in config.json.
The setup prioritizes WinGet over Chocolatey for better performance and native Windows integration. Use Chocolatey primarily for:
- Specialized development tools not available in WinGet
- Font installations
- Legacy packages
{
"chocolatey": {
"clis": [],
"fonts": ["sourcecodepro"],
"apps": []
},
"winget": [
"Git.Git",
"Microsoft.VisualStudioCode",
"Microsoft.WindowsTerminal"
],
"vscode_extensions": [
"ms-vscode.powershell",
"eamodio.gitlens"
]
}{
"winget": [
"Git.Git",
"OpenJS.NodeJS",
"Microsoft.VisualStudioCode",
"Docker.DockerDesktop",
"Mozilla.Firefox",
"Google.Chrome",
"Postman.Postman"
],
"vscode_extensions": [
"ms-vscode.vscode-typescript-next",
"bradlc.vscode-tailwindcss",
"esbenp.prettier-vscode",
"ms-vscode.vscode-json"
]
}{
"winget": [
"Python.Python.3.12",
"Git.Git",
"Microsoft.VisualStudioCode",
"JetBrains.PyCharm.Community"
],
"vscode_extensions": [
"ms-python.python",
"ms-python.pylint",
"ms-toolsai.jupyter"
]
}Purpose: Installs development tools, applications, and fonts using WinGet and Chocolatey.
Features:
- Automatic elevation to Administrator
- Package manager installation and verification
- Robust error handling with detailed reporting
- Configuration-driven installation
- Installation summary with success rates
Usage:
.\apps.ps1Purpose: Installs VS Code extensions from the configuration file.
Features:
- VS Code availability verification
- Individual extension error handling
- Installation progress tracking
- Detailed failure reporting
Usage:
.\vs-code.ps1Note: VS Code must be installed and added to PATH before running this script.
Purpose: Enables Windows Subsystem for Linux and sets WSL2 as default.
Features:
- Enables WSL feature
- Enables Virtual Machine Platform
- Sets WSL2 as default version
Usage:
.\wsl.ps1Note: Requires system restart after execution.
Purpose: Displays Windows product key from registry.
Usage:
cscript productkey.vbs# Solution: Set execution policy temporarily
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# Run your scripts, then reset
Set-ExecutionPolicy -ExecutionPolicy Restricted -Scope CurrentUser- Install from Microsoft Store: "App Installer"
- Or download from GitHub releases
- Restart terminal after installation
# Manual installation
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'))- Check internet connection
- Verify package names/IDs in configuration
- Run as Administrator
- Check Windows version compatibility
- Ensure VS Code is in PATH:
code --version - Restart VS Code after installation
- Check extension compatibility with VS Code version
The scripts include comprehensive error handling:
- Continue on failure: Individual package failures don't stop the entire process
- Detailed logging: Clear success/failure indicators with error messages
- Summary reports: Complete overview of what succeeded, failed, or was skipped
- Graceful degradation: Scripts adapt when package managers aren't available
- Check the summary report at the end of script execution
- Review failed packages and error messages
- Verify prerequisites are met
- Check package availability in respective package managers
- Run individual commands manually to isolate issues
- Backup important data before major system changes
- Close unnecessary applications to avoid conflicts
- Ensure stable internet connection
- Review configuration to understand what will be installed
- Start small: Begin with a minimal configuration and add packages gradually
- Test changes: Validate configuration JSON syntax before running scripts
- Keep backups: Save working configurations for different scenarios
- Version control: Track configuration changes in git
- Regular updates: Keep package lists current with latest versions
- Remove unused packages: Clean up configuration periodically
- Update scripts: Pull latest improvements from repository
- Document changes: Comment significant configuration modifications
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly on a clean Windows installation
- Submit a pull request with detailed description
- Additional package configurations for different development stacks
- Improved error handling and user experience
- Cross-platform compatibility (PowerShell Core)
- Additional utility scripts
- Documentation improvements
This project is open source and available under the MIT License.
- v3.0 - Added robust error handling and comprehensive documentation
- v2.0 - Externalized configuration to JSON, migrated to WinGet
- v1.0 - Initial PowerShell automation scripts
Happy coding! π
If you find this project helpful, please consider giving it a star β on GitHub.