LinuxLoveWindows is a PowerShell module that helps you save and load commands from your Windows Subsystem for Linux (WSL) environment into your PowerShell session.
- Imports Linux commands into PowerShell.
- Loads previously saved Linux commands automatically on module import.
๐ฝ๏ธOpen YouTube to watch the full demo in Bahasa Indonesia
- Windows with WSL installed.
- PowerShell 6.0 or newer.
WslInterop
PowerShell module installed.
Use this command
Install-Module -Name LinuxLoveWindows
or download this repository to PowerShell module location (e.g., C:\Program Files\PowerShell\6\Modules\
).
- Open PowerShell.
- Edit your PowerShell profile by running:
notepad $Profile
- Add the following line:
#Uncomment the line below to ensure all Linux commands are imported and replace equivalent Windows commands when doing 'Import-Linux'. #$env:LINUX_CMD="all" Import-Module LinuxLoveWindows
- Save and close the profile file.
- Restart PowerShell, then call the function:
It will import commands that are not present in Windows unless accompanied by an environment variable. You can import all commands to the current PowerShell session with 'Import-Linux -all'.
Import-Linux
This function will collect a list of commands from Linux, filter them, and import each command into your PowerShell session.
- Ensure your WSL environment is properly set up and accessible from PowerShell.
- To remove a command from autoload, manually delete it from the
imported_linux_commands.txt
in your Windows user home directory.