From f7e1ec1c2d9c5fac62b3c8632b01ba4823c9b4d3 Mon Sep 17 00:00:00 2001 From: AndreasBrostrom Date: Thu, 3 Oct 2024 20:12:07 +0200 Subject: [PATCH] Exit loop if if it is a errors --- upgrade.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/upgrade.ps1 b/upgrade.ps1 index 2089b54..ca8a846 100644 --- a/upgrade.ps1 +++ b/upgrade.ps1 @@ -144,9 +144,9 @@ function runWSLUpdate { $i++ if ($i -lt 2) {return} if ($_ -eq "") {return} - if ($_.contains("Copyright")) {return} - if ($_.contains("Distributions")) {return} - if ($_.contains("https://aka.ms/wslstore")) {return} + if ($_.contains("Copyright")) {break} + if ($_.contains("Distributions")) {break} + if ($_.contains("https://aka.ms/wslstore")) {break} $dist = -split "$_" $distName = $dist[0] $DistrosList += $distName