Skip to content

Allow the addition of Environment Variables to PowerShell Exe configuration #1472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rjmholt opened this issue Aug 7, 2018 · 11 comments
Closed
Labels
Area-Configuration Issue-Enhancement A feature request (enhancement). Resolution-Inactive Will close automatically.

Comments

@rjmholt
Copy link
Contributor

rjmholt commented Aug 7, 2018

See #1288 (comment) 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...

@rjmholt
Copy link
Contributor Author

rjmholt commented Aug 7, 2018

Related to #1470.

@rjmholt rjmholt added the Up for Grabs Will shepherd PRs. label Oct 10, 2018
@peterblazejewicz
Copy link

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"
            ],
        }
    ]
}

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label May 26, 2020
@SydneyhSmith SydneyhSmith removed the Needs: Maintainer Attention Maintainer attention needed! label May 26, 2020
@chuachengling
Copy link

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

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Apr 7, 2021
@SadokLadhari
Copy link

Any news about this feature please ?

@rjmholt
Copy link
Contributor Author

rjmholt commented Apr 22, 2021

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.

@SydneyhSmith SydneyhSmith removed the Needs: Maintainer Attention Maintainer attention needed! label Apr 22, 2021
@ggirard07
Copy link

Does anyone have a workaround for this while using an interactive session instead of a/current script?

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Nov 2, 2021
@StevenBucher98 StevenBucher98 removed the Needs: Maintainer Attention Maintainer attention needed! label Nov 9, 2021
@marcelotmelorax
Copy link

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"
            ],
        }
    ]
}

It seems that "args" is ignored when there's a Set-Item in the script. At least it did not work for me, I had to add the args in the end of the script as if I was typing them in the command line. If I don't do like the example below the terminal keeps asking me for values for the mandatory script parameters.

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

@CaseyLaux
Copy link

Bumping this to hope it gets seen. Having the same issue now

@andyleejordan andyleejordan added the Needs: Triage Maintainer attention needed! label May 22, 2023
@andyleejordan
Copy link
Member

Hey @CaseyLaux! This is a very old issue, and looking at it, it appears that people are talking about different things. Could you please open a new issue and explain what you're trying to accomplish so we can help you? Thanks!

@andyleejordan andyleejordan added Resolution-Inactive Will close automatically. and removed Up for Grabs Will shepherd PRs. Area-Extension Terminal Needs: Triage Maintainer attention needed! labels Jun 7, 2023
@ghost
Copy link

ghost commented Jun 7, 2023

This issue has been marked as inactive. It has been automatically closed for housekeeping purposes.

@ghost ghost closed this as completed Jun 7, 2023
@JavaScriptDude
Copy link

For the record, this feature request is not moot and should be implemented. The fact that this is auto-closed flags a fundamental issue with issue tracking in general.

I would have this issue flagged as a JDI (just do it) ticket. I used to admin Issue trackers for decades and this idea of JDI was something I implemented for all my enterprise projects. JDI flagged tickets should never be auto closed, and should not be considered in open issue KPIs as they are just common sense stuff, however not high enough priority to get done promptly.

Thanks for your consideration.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Configuration Issue-Enhancement A feature request (enhancement). Resolution-Inactive Will close automatically.
Projects
None yet
Development

No branches or pull requests