Skip to content

Commit

Permalink
added better check for for wsl dists
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasBrostrom committed Nov 21, 2023
1 parent 49848be commit 029fef5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion upgrade.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,11 @@ function runWSLUpdate {

$distrosList = @()
Try {
$i=0
wsl.exe --list | ForEach-Object -Process {
$i++
if ($i -lt 2) {return}
if ($_ -eq "") {return}
if ($_ -eq "Windows Subsystem for Linux Distributions:") {return}
$dist = -split "$_"
$distName = $dist[0]
$DistrosList += $distName
Expand Down

0 comments on commit 029fef5

Please sign in to comment.