When I run script ("example":"docker ps") via WebStorm run button, I get:
'docker' is not recognized as an internal or external command,
operable program or batch file.
PowerShell script works in Windows 11 terminal.
My aliases for docker:
# powershell
function docker { wsl -- docker $args }
# cmd
@echo off
DOSKEY docker=wsl -- docker $*
How to resolve this problem? I'm using pnpm.

DOSKEYdefinition won't work in PowerShell (except if you unload thePSReadLinemodule, which significantly diminishes the command-line editing experience). For your PowerShellfunctionto be available on startup, you must add it to a/your$PROFILEfile (and make sure that PowerShell isn't started with-NoProfile, which seems to be the case). As an aside: For robustness I suggest defining the function asfunction docker { wsl -e docker $args }