Skip to content

Commit

Permalink
Merge pull request #4 from oleksis/racher-desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
sirredbeard authored Jun 7, 2023
2 parents ff8ff61 + 3335a6e commit e8404b2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion list-wsl.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ $wslDistributions = Get-ChildItem -Path "HKCU:\SOFTWARE\Microsoft\Windows\Curren
if ($distribution["Name"] -eq "docker-desktop") { $distribution["Linux Distro"] = "Docker Desktop"; $distribution["State"] = "Installed"; $distribution["WSL"] = 2; $distribution["systemd"] = "Disabled"; $distribution["Default User"] = ""; $distribution["Distro Version"] = "" }
if ($distribution["Name"] -eq "docker-desktop-data") { $distribution["Linux Distro"] = "Docker Desktop Data"; $distribution["State"] = "Installed"; $distribution["WSL"] = 2; $distribution["systemd"] = "Disabled"; $distribution["Default User"] = ""; $distribution["Distro Version"] = "" }
if ($distribution["Name"] -eq "docker-desktop-runtime") { $distribution["Linux Distro"] = "Docker Desktop Runtime"; $distribution["State"] = "Installed"; $distribution["WSL"] = 2; $distribution["systemd"] = "Disabled"; $distribution["Default User"] = ""; $distribution["Distro Version"] = "" }
if ($distribution["Name"] -eq "rancher-desktop") { $distribution["Linux Distro"] = "Rancher Desktop WSL Distribution"; $distribution["State"] = "Installed"; $distribution["WSL"] = 2; $distribution["systemd"] = "Disabled"; $distribution["Default User"] = ""; $distribution["Distro Version"] = "" }
if ($distribution["Name"] -eq "rancher-desktop-data") { $distribution["Linux Distro"] = "Rancher Desktop Data"; $distribution["State"] = "Installed"; $distribution["WSL"] = 2; $distribution["systemd"] = "Disabled"; $distribution["Default User"] = ""; $distribution["Distro Version"] = "" }

if ($distribution["Name"] -ne "docker-desktop" -and $distribution["Name"] -ne "docker-desktop-data" -and $distribution["Name"] -ne "docker-desktop-runtime") {
if ($distribution["Name"] -ne "docker-desktop" -and $distribution["Name"] -ne "docker-desktop-data" -and $distribution["Name"] -ne "docker-desktop-runtime" -and $distribution["Name"] -ne "rancher-desktop" -and $distribution["Name"] -ne "rancher-desktop-data") {
$osRelease = Invoke-Expression "wsl.exe -d $($distribution["Name"]) cat /etc/os-release"
if ($osRelease) {
$distribution["Linux Distro"] = ($osRelease | Where-Object { $_ -like "PRETTY_NAME=*" }).Split("=")[1].Replace('"', '')
Expand Down

0 comments on commit e8404b2

Please sign in to comment.