I want my powershell script to detect which WSL distribution is installed
PS> wsl -l
Windows Subsystem for Linux Distributions:
Ubuntu (Default)
PS> wsl -l | where {$_ -match "^Ubuntu"}
# Doesn't print anything
I would expect it to print:
Ubuntu (Default)
A few more experiments:
PS> $x = wsl -l
PS> $x.GetType()
True True Object[] System.Array
PS> $x[0].GetType()
True True String System.Object
PS> $x[1].GetType()
True True String System.Object