This PowerShell script automates the setup of Windows Subsystem for Linux (WSL) with Ubuntu 20.04.
- Enables WSL and Virtual Machine Platform features.
- Sets WSL 2 as the default version.
- Installs Ubuntu 20.04 LTS using Winget (if not already installed).
- Sets Ubuntu 20.04 as the default WSL distribution.
- Windows 10 (version 2004 or later) or Windows 11
- PowerShell running as Administrator
- Internet connection
- Winget installed (comes pre-installed on modern Windows)
- Download the
configure_wsl.ps1script. - Open PowerShell as Administrator.
- Run the script:
powershell -ExecutionPolicy Bypass -File configure_wsl.ps1You can include this script as part of a full system automation process (e.g., with a .bat file for reinstalling apps and restoring configs).
MIT License β feel free to use and modify.