Quick reference commands for dealing with wsl in windows10

list wsl distro

this also returns the version of the distro you are running

wsl -l -v

upgrade distro from wsl1 to wsl2

Get the distro name from wsl -l -v in the below example im upgrading ubuntu from wsl1 to 2

wsl --set-version Ubuntu-18.04 2

set new default distro

wsl -s Ubuntu-18.04

restart wls distro

wsl -t Ubuntu-18.04

uninstall single distro

go into windows apps and features select the distro you wish to uninstall and select remove

unregister via the command line

wsl --unregister Ubuntu-18.04

install single distro

go to windows store and search with wsl

install via the command line

Invoke-WebRequest https://aka.ms/wsl-kali-linux-new -OutFile kali.appx -UseBasicParsing
Add-AppxPackage .\kali.appx

wslconfig

as well as wsl there is also a wslconfig command

list distros

wslconfig.exe /l

set new default distro

wslconfig.exe /setdefault Ubuntu-18.04