Today I'm just looking to check if a specific subsystem is installed on my windows workstation. So I'm using Windows Subsystem for Linux (WSL) and install Ubuntu available from Microsoft Store. Now i'm trying to have a way to check if it's installed in a programmatic manner.
I've this output:
PS C:\> wsl -l -v
NAME STATE VERSION
* Ubuntu-20.04 Stopped 2
And I need to know if "Ubuntu-20.04" is installed. I've tried many things, but nothing revelant like:
$state = wsl -l -v
if($state -like '*Ubuntu*') {
Write-Host 'Installed'
} else {
Write-Host 'Nope'
}
But not working. Do you have a clue for me ? Thanks everyone !