Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 1.94 KB

File metadata and controls

57 lines (41 loc) · 1.94 KB

Linux 💘 Windows

Thumbnail

LinuxLoveWindows is a PowerShell module that helps you save and load commands from your Windows Subsystem for Linux (WSL) environment into your PowerShell session.

Features

  • Imports Linux commands into PowerShell.
  • Loads previously saved Linux commands automatically on module import.

Demo

Demo

📽️Open YouTube to watch the full demo in Bahasa Indonesia

Requirements

  • Windows with WSL installed.
  • PowerShell 7.0 or newer.
  • WslInterop PowerShell module installed.

Installation

Use this command

Install-Module -Name LinuxLoveWindows

or download this repository to PowerShell module location (e.g., C:\Program Files\PowerShell\7\Modules\).

Usage

  1. Open PowerShell.
  2. Edit your PowerShell profile by running:
    notepad $Profile
  3. Add the following line:
    #Uncomment the line below to ensure all Linux commands are imported and replace equivalent Windows commands when doing 'Import-LinuxCommands'.
    #$env:LINUX_CMD="all"
    Import-Module LinuxLoveWindows
  4. Save and close the profile file.
  5. Restart PowerShell, then call the function:
    Import-LinuxCommands
    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-LinuxCommands -all'.

This function will collect a list of commands from Linux, filter them, and import each command into your PowerShell session.

Note

  • 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.