|
@ -9284,8 +9284,8 @@ function Install-WSL |
|
|
[System.Console]::OutputEncoding = [System.Text.Encoding]::Unicode |
|
|
[System.Console]::OutputEncoding = [System.Text.Encoding]::Unicode |
|
|
|
|
|
|
|
|
$wsl = wsl --list --online |
|
|
$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 |
|
|
# We need to get the string number 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 |
|
|
$LineNumber = ($wsl | Select-String -Pattern "FRIENDLY NAME" -CaseSensitive).LineNumber |
|
|
# Remove first strings in output from the first to the $MinimumLineNumber |
|
|
# Remove first strings in output from the first to the $MinimumLineNumber |
|
|
$Distros = ($wsl).Replace(" ", "").Replace("* ", "")[($MinimumLineNumber)..(($wsl).Count)] | ForEach-Object -Process { |
|
|
$Distros = ($wsl).Replace(" ", "").Replace("* ", "")[($MinimumLineNumber)..(($wsl).Count)] | ForEach-Object -Process { |
|
|
[PSCustomObject]@{ |
|
|
[PSCustomObject]@{ |
|
|