Comment by colejohnson66
1 month ago
What's "missing" is the ability to launch things the "Bash" way: `KEY=value ./myApp`. Where the variable is scoped to the single execution.
Windows' command prompt requires two separate invocations:
set KEY=value
./myApp
PowerShell also:
$env:KEY='value'
./myApp
Or more "verbosely/explicitly":
[System.Environment]::SetEnvironmentVariable('KEY', 'value')
./myApp
Regardless, all those methods aren't "scoped".
eh `cmd /C "set KEY=value && ./myApp"` isn't that bad if you really need complete isolation.
or directly in powershell, `Start-Process myproc.exe -Environment @{ FOO = 'bar' }`
What an absolutely awful syntax.
How Powershell ever got popular is beyond me.
3 replies →