It's a really genius thing and kudos to Mike for sharing it with us! Go try it now. Once you're done, you can just open PowerShell Core and mix and match your commands!įrom the blog, "With these function wrappers in place, we can now call our favorite Linux commands in a more natural way without having to prefix them with wsl or worry about how Windows paths are translated to WSL paths:" Make sure you change it to expose the WSL/Linux commands that you want. You'll do your Install-Module just one, and then run notepad $profile and add just a that single last line. Import commands with Import-WslCommand either from your profile for persistent access or on demand when you need a command (e.g.Install the WslInterop module with Install-Module WslInterop.Install the Windows Subsystem for Linux (WSL).These function wrappers are very neatly designed and even expose TAB completion across operating systems! That means I can type Linux commands in PowerShell and TAB completion comes along! It's actually pretty amazing and very natural if you, like me, are non-denominational in your choice of operating system and preferred shell. This might seem weird but it allows us to create amazing piped commands that move in and out of Windows and Linux, PowerShell and bash. Now there's a new series of "function wrappers" that make Linux commands available directly in PowerShell so you can easily transition between multiple environments. No matter what shell you're using in Windows (powershell, yori, cmd, whatever) you can always call into your default Ubuntu instance with "wsl command" so "wsl ls" or "wsl grep" but it'd be nice to make those more naturally and comfortably integrated. NET Core based engine and powerful scripting language, you might still miss common *nix shell commands like ls, grep, sed and more. If you're using a Windows shell like PowerShell because you like it's. You might use Ubuntu or Mac and you've picked your shell like zsh or bash or pwsh, but then you come to Windows and we're hopping between shells (and now operating systems with WSL!) on a tab by tab basis. I posted recently about What's the difference between a console, a terminal, and a shell? The world of Windows is interesting - and a little weird and unfamiliar to non-Windows people.
0 Comments
Leave a Reply. |