From 70c543e9b343c04579134d792f26aa3da74027eb Mon Sep 17 00:00:00 2001 From: Manuel Engel <43782561+manie204@users.noreply.github.com> Date: Thu, 16 Jul 2020 11:28:57 +0200 Subject: [PATCH] Fix bug with only one distro in powershell script (#9) --- move-wsl.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/move-wsl.ps1 b/move-wsl.ps1 index 6f1e23d..d67aca3 100644 --- a/move-wsl.ps1 +++ b/move-wsl.ps1 @@ -24,7 +24,7 @@ function Get-Distros() # get and make sure there are distros Write-Host 'Getting distros...'; -$distroList = Get-Distros; +$distroList = @(Get-Distros); if ($distroList.Length -le 0) { Write-Error 'No distro found'; @@ -86,7 +86,7 @@ Write-Host "Importing $distro from $targetFolder..." & cmd /c wsl --import $distro $targetFolder "`"$tempFile`""; # Validating -$newDistroList = Get-Distros; +$newDistroList = @(Get-Distros); if ($newDistroList -notcontains $distro) { Write-Error "Import failed. Distro not found. Export file at $tempFile";