|
@ -9346,10 +9346,10 @@ function Install-WSL |
|
|
# We need to get the string number 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 |
|
|
$LineNumber = ($wsl | Select-String -Pattern "FRIENDLY NAME" -CaseSensitive).LineNumber |
|
|
$LineNumber = ($wsl | Select-String -Pattern "FRIENDLY NAME" -CaseSensitive).LineNumber |
|
|
# Remove first strings in output from the first to the $LineNumber |
|
|
# Remove first strings in output from the first to the $LineNumber |
|
|
$Distros = ($wsl).Replace(" ", "").Replace("* ", "")[($LineNumber)..(($wsl).Count)] | ForEach-Object -Process { |
|
|
$Distros = ($wsl).Replace("* ", "")[($LineNumber)..(($wsl).Count)] | ForEach-Object -Process { |
|
|
[PSCustomObject]@{ |
|
|
[PSCustomObject]@{ |
|
|
"Distro" = $_ -split " ", 2 | Select-Object -Last 1 |
|
|
"Distro" = ($_ -split " ", 2 | Select-Object -Last 1).Trim() |
|
|
"Alias" = $_ -split " ", 2 | Select-Object -First 1 |
|
|
"Alias" = ($_ -split " ", 2 | Select-Object -First 1).Trim() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|