TylerLeonhardt / PSWsl

Interact with WSL over PowerShell!
MIT License
46 stars 2 forks source link

There is an issue using Get-WslDistribution #17

Closed patrick330602 closed 6 years ago

patrick330602 commented 6 years ago

It seems that it has trouble displaying the distribution properly:

image

I am using Windows 10 build 17134.5 right now.

TylerLeonhardt commented 6 years ago

Thanks for this! This is likely a dupe of #12... Are you using Windows PowerShell? If you run:

$a = wslconfig /l
$a

does it look funky?

patrick330602 commented 6 years ago

@tylerl0706 Yep, it looks like there are spaces between each character

TylerLeonhardt commented 6 years ago

Yeah - If you try it on PSCore, it should be better. The problem is this line:

https://github.com/tylerl0706/PSWsl/blob/master/PSWsl.psm1#L160

Which works on PSCore but not Windows PowerShell :(

I'll dupe my issue to yours since you have an image :)

patrick330602 commented 6 years ago

Well, find a way which (kind of) works: image

the code is here:

[System.Text.Encoding]::Unicode.GetString([System.Text.Encoding]::UTF8.GetBytes((wslconfig.exe /l))) -split '\s\s+' | Select-Object -Skip 1 -Unique
patrick330602 commented 6 years ago

I will close this as it is merged