Created
February 11, 2020 07:07
-
-
Save ElJefeDSecurIT/b8de7f3852e4458c1935d1e1af399966 to your computer and use it in GitHub Desktop.
WSLHere
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## in case you want to have a wslHere dropdown in Windows: | |
$null = 0..1 | % { | |
$key = New-Item -Force $('HKCU:\Software\Classes\Directory{0}\shell\WSLHere' -f ('', '\Background')[$_]) | |
$key | New-ItemProperty -Name '(Default)' -Value 'WSL Here' -Type String | |
$key | New-ItemProperty -Name 'Icon' -Value '%LOCALAPPDATA%\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\share\wslu\wsl.ico' -Type ExpandString | |
$key = New-Item -Force "$($key.PsPath)\command" | |
$key | New-ItemProperty -Name '(Default)' -Value "cmd /c cd `"$(('%1', '%V')[$_])`" && wsl.exe" -Type String | |
} | |
## ## to remove the above. | |
## 0..1 | % { | |
## Remove-Item -Recurse -LiteralPath $('HKCU:\Software\Classes\Directory{0}\shell\WSLHere' -f ('', '\Background')[$_]) | |
## } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment