N
N
Nikname_non_name2019-09-29 11:47:49
Microsoft
Nikname_non_name, 2019-09-29 11:47:49

WSL and PowerShell integration?

Hello!
In Powershell (ps) you can type cmd and get into the command line, wsl and get into the Linux subsystem, in wsl you can execute Linux commands, but Windows cannot. How to make it so that if you enter powershell in wsl, then the PowerShell shell will open, if you enter cmd, then the command line will open (as if you enter cmd in ps) ?! How to make it possible to execute Linux commands in PowerShell and Windows commands in WSL?!
How to implement everything?!!! Please help, please don't ignore me!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
res2001, 2019-09-29
@res2001

Personally, I didn't need it, but it already works right now.
Only in wsl you need to run not cmd, but cmd.exe, not powershell, but powershell.exe - i.e. specify the full name of the Windows executable file. For system utilities, this works without specifying a path, because Windows system directories are registered in the PATH wsl variable, for programs installed in "Program Files" or in other places, you must specify the full path. Windows disks are mounted in wsl at /mnt/c/, /mnt/d/, ...
https://docs.microsoft.com/ru-ru/windows/wsl/interop

K
Konstantin Tsvetkov, 2019-09-29
@tsklab

yesterday at 13:41

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question