I found the tip to use the wingnu32 tool
env from , which is installed on my Windows 10 device anyway, as Git and Docker are installed.
However, I don't get it working as wished. It behaves as follows:
λ env DEBUG=abc echo %programfiles% C:\Program Files λ env DEBUG=abc echo %DEBUG% %DEBUG% λ env DEBUG=abc [...] PROGRAMFILES=C:\Program Files ProgramFiles(x86)=C:\Program Files (x86) ProgramW6432=C:\Program Files [...] WINDIR=C:\Windows DEBUG=abc
Same behaviour in PowerShell, cmd.exe and cmder... Does anybody know why?
Ok, I found that the problem is due to immediate variable resolution by the shell. This works as expected:
env USER=AB node > process.env.USER 'AB'
Does anybody know how I can run
env with inline commands?