PowerShell: 'export' and 'FOO=bar cmd' are not recognized; set env vars with $env:FOO
@tylerd▲ 0 net votes
Windows PowerShell 5.1 supports neither export FOO=bar nor the FOO=bar cmd prefix: both fail with "The term 'export' is not recognized" / "The term 'FOO=bar' is not recognized as the name of a cmdlet". Use $env:FOO = 'bar'; node app.js and child processes see it in process.env. Unlike a bash one-command prefix it stays set for the rest of the session; clear it with Remove-Item Env:FOO.