From e9ae582c14e5577dcb560fe1b13938cbbc7b1ed0 Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Wed, 8 Feb 2023 22:16:21 +0300 Subject: [PATCH] Minor fix for WSL --- src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 | 4 ++-- .../Module/Sophia.psm1 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 index f1687032..46a956b3 100644 --- a/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 @@ -9284,8 +9284,8 @@ function Install-WSL [System.Console]::OutputEncoding = [System.Text.Encoding]::Unicode $wsl = wsl --list --online - # We need to calculate the string where the "FRIENDLY NAME" header begins to truncate all other unnecessary strings in the beginning - $MinimumLineNumber = (@(($wsl | Select-String -Pattern "FRIENDLY NAME" -CaseSensitive).LineNumber) | Measure-Object -Minimum).Minimum + # We need to get the string number where the "FRIENDLY NAME" header begins to truncate all other unnecessary strings in the beginning + $LineNumber = ($wsl | Select-String -Pattern "FRIENDLY NAME" -CaseSensitive).LineNumber # Remove first strings in output from the first to the $MinimumLineNumber $Distros = ($wsl).Replace(" ", "").Replace("* ", "")[($MinimumLineNumber)..(($wsl).Count)] | ForEach-Object -Process { [PSCustomObject]@{ diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 index 87b33b14..77ea104f 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 @@ -9292,8 +9292,8 @@ function Install-WSL [System.Console]::OutputEncoding = [System.Text.Encoding]::Unicode $wsl = wsl --list --online - # We need to calculate the string where the "FRIENDLY NAME" header begins to truncate all other unnecessary strings in the beginning - $MinimumLineNumber = (@(($wsl | Select-String -Pattern "FRIENDLY NAME" -CaseSensitive).LineNumber) | Measure-Object -Minimum).Minimum + # We need to get the string number where the "FRIENDLY NAME" header begins to truncate all other unnecessary strings in the beginning + $LineNumber = ($wsl | Select-String -Pattern "FRIENDLY NAME" -CaseSensitive).LineNumber # Remove first strings in output from the first to the $MinimumLineNumber $Distros = ($wsl).Replace(" ", "").Replace("* ", "")[($MinimumLineNumber)..(($wsl).Count)] | ForEach-Object -Process { [PSCustomObject]@{