Running pwsh in WSL via ConEmu

I was setting up ConEmu on Windows to run Powershell Core within my WSL Ubuntu installation. The latest ConEmu includes wslbridge and is preconfigured to launch bash like this:

set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pm:/mnt

Behind the scenes this runs wslbridge, which in turn launches the default shell (bash) in a TTY. The TTY is only enabled by default when running the default shell. If we specify a custom executable, we must also specify -t to enable the TTY. Putting it together, plus a few PowerShell flags, we append -t pwsh -NoLogo -ExecutionPolicy RemoteSigned.

set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pm:/mnt -t pwsh -NoLogo -ExecutionPolicy RemoteSigned


Leave a Comment