I want to see if I'm running a particular wsl distribution (Windows 10 Home, WSL 2):
PS C:\Users\User> wsl --list --running
Windows Subsystem for Linux Distributions:
Ubuntu (Default)
MyDistro
PS C:\Users\User> wsl --list --running | Select-String -Pattern "MyDistro"
PS C:\Users\User>
No output. I used Get-Member
to see that the output is a string; if I run it through something like | Out-String -stream
it makes no difference.
I can get a match with Select-String .
or Select-String .*
but it matches everything, which isn't helpful.
Yes, I want to see if there's a running distro with a particular name. Is there a better way to do that in PowerShell?