2019-10-10 18:10:17 -05:00
|
|
|
param (
|
|
|
|
[string]
|
2019-10-21 19:37:23 -05:00
|
|
|
$CommandPath = "konsole"
|
2019-10-10 18:10:17 -05:00
|
|
|
)
|
|
|
|
|
2020-02-13 18:24:09 -06:00
|
|
|
$server = (wsl.exe cat /etc/resolv.conf | Select-String nameserver | Out-String | ForEach-Object { $_.Split(" ")[1]}).Trim()
|
2019-10-21 19:37:23 -05:00
|
|
|
# Set the display variable for this process
|
2020-02-13 18:24:09 -06:00
|
|
|
Set-Item -Path Env:DISPLAY "$server`:0.0"
|
2019-10-21 19:37:23 -05:00
|
|
|
Set-Item -Path Env:WSLENV "DISPLAY/u"
|
|
|
|
|
|
|
|
Start-Process -FilePath "wsl.exe" -ArgumentList $CommandPath -WindowStyle Hidden
|