Protected
Readonly
executes wsl.exe --list to get the list of WSL distributions. The Output format look like this:
wsl.exe --list
NAME STATE VERSION* Ubuntu Stopped 2 Other Distro Stopped 2 Copy
NAME STATE VERSION* Ubuntu Stopped 2 Other Distro Stopped 2
so we split the output by lines and then by whitespace. The * indicates the default distribution so this has to be handled slightly different.
a list of WslDistribution objects, each containing the name, default status, and version.
executes
wsl.exe --list
to get the list of WSL distributions. The Output format look like this:so we split the output by lines and then by whitespace. The * indicates the default distribution so this has to be handled slightly different.