Vscode-powershell: Allow the addition of Environment Variables to PowerShell Exe configuration

Created on 7 Aug 2018  路  5Comments  路  Source: PowerShell/vscode-powershell

See https://github.com/PowerShell/vscode-powershell/issues/1288#issuecomment-387255899 for the proposal.

The suggested form is:

"powershell.powerShellAdditionalExePaths": [
        {
            "versionName": "with-xterm-env-var",
            "exePath": "pwsh",
            "env": {
                "TERM": "xterm"
            }
        }
    ]

This would require some input sanitisation to ensure the environment variables aren't an override...

Area-Configuration Area-Integrated Console Issue-Enhancement Up-for-Grabs

Most helpful comment

Any news about this feature please ?

No news. We're still working through several high priority items in our backlog. This issue is marked as "up for grabs" to indicate that it's free for anyone to pick up and contribute a solution to.

All 5 comments

For anyone interested, this is how we are doing this until env support lands for multi-variable and multi-params:

{
    ...
    "configurations": [
        {
            ...
            "script": "Set-Item -Path Env:VarOneName -Value VarValue; & Set-Item -Path Env:VarTwoName -Value VarValue; & Set-Item -Path Env:VarThreeName -Value VarValue; & ${workspaceFolder}/scripts/build/script.ps1",
            "args": [
                "-ParamOneName ParamValue",
                "-ParamTwoName ParamValue"
            ],
        }
    ]
}

Hey there, tried using script, but it seems that script function is not allowed on vscode?

Any news about this feature please ?

Any news about this feature please ?

No news. We're still working through several high priority items in our backlog. This issue is marked as "up for grabs" to indicate that it's free for anyone to pick up and contribute a solution to.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

daviwil picture daviwil  路  4Comments

lukegriffith picture lukegriffith  路  3Comments

guidooliveira picture guidooliveira  路  3Comments

inthemedium picture inthemedium  路  3Comments

MiYanni picture MiYanni  路  3Comments