Working with the new VSCode editor on a node.js project. I am attempting to configure my \"Launch\" profile for debugging by editing the launch.json file. I need to setup a
as a workaround, you can set environment variables when starting VSCode, for example, using this little powershell script:
param(
$vars = @{}
)
$vars.Keys | % {
write-host "adding env variable: $_=$($vars[$_])"
[Environment]::SetEnvironmentVariable($_, $vars[$_], "Process")
}
$ver = "0.1.0"
& "$env:LOCALAPPDATA\Code\app-$ver\Code.exe"
Save it as vscode.ps1
and call it from commandline, like this:
powershell ".\vscode.ps1 -vars @{ 'NODE_ENV'='test'; 'SOMETHING'='else' }"