Install
openclaw skills install wsl-powershellControl Windows PowerShell from WSL by executing commands and scripts on the Windows host using mounted Windows executables.
openclaw skills install wsl-powershellCall Windows PowerShell from WSL to control Windows host from Linux environment.
WSL mounts Windows drives to /mnt/, allowing direct execution of Windows binaries:
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe/mnt/c/Windows/System32/cmd.exe/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command "Your-Command"
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -File "/mnt/c/path/to/script.ps1"
# Get system info
powershell.exe -Command "Get-ComputerInfo"
# Get process list
powershell.exe -Command "Get-Process | Select-Object -First 10 Name,Id,CPU"
# Get service status
powershell.exe -Command "Get-Service | Where-Object {$_.Status -eq 'Running'} | Select-Object -First 10 Name,DisplayName"
# List directory
powershell.exe -Command "Get-ChildItem C:\\Users"
# Copy file
powershell.exe -Command "Copy-Item C:\\source\\file.txt C:\\dest\\file.txt"
# Create file
powershell.exe -Command "New-Item -Path C:\\test.txt -ItemType File -Force"
# Start program
powershell.exe -Command "Start-Process notepad.exe"
# Stop process
powershell.exe -Command "Stop-Process -Name notepad -Force"
# Get network config
powershell.exe -Command "Get-NetIPConfiguration"
# Ping test
powershell.exe -Command "Test-Connection -ComputerName google.com -Count 2"
WSL Path ↔ Windows Path:
/mnt/c/Users/Tao ↔ Windows: C:\Users\Taowslpath command:
wslpath -w /mnt/c/Users # Output: C:\Users
wslpath -u C:\\Users # Output: /mnt/c/Users
-Verb RunAs for elevated PowerShell\ in Windows paths must be escaped as \\Set-ExecutionPolicy