Utilities for working with Windows Subsystem for Linux (WSL)
npm install wsl-utils
import {isWsl, powerShellPathFromWsl} from 'wsl-utils';
// Check if running in WSL
console.log('Is WSL:', isWsl);
// Get PowerShell path from WSL
console.log('PowerShell path:', await powerShellPathFromWsl());
//=> '/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe'
Type: boolean
Check if the current environment is Windows Subsystem for Linux (WSL).
Returns: Promise<string>
Get the PowerShell executable path in WSL environment.
Returns: Promise<string>
Get the PowerShell executable path for the current environment.
Returns WSL path if in WSL, otherwise returns Windows path.
Returns: Promise<string>
Get the mount point for fixed drives in WSL.