Skip to content

Enable running PowerShell with Arguments (ex: -sta) #2476

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
PeterHodges15 opened this issue Feb 18, 2020 · 4 comments
Closed

Enable running PowerShell with Arguments (ex: -sta) #2476

PeterHodges15 opened this issue Feb 18, 2020 · 4 comments
Labels
Resolution-Duplicate Will close automatically.

Comments

@PeterHodges15
Copy link

PeterHodges15 commented Feb 18, 2020

Issue Type: Feature Request

n Settings.JSON I can specify:

"powershell.powerShellAdditionalExePaths": [
{
"exePath": "C:\Program Files\PowerShell\7-preview\pwsh.exe",
"versionName": "7-preview",
},

But this does not enable me to start up Powershell with certain arguments.
Namely I want to start like:

"powershell.powerShellAdditionalExePaths": [
{
"exePath": "C:\Program Files\PowerShell\7-preview\pwsh.exe",
"Arguments": "-sta",
"versionName": "7-preview",
},

so that the thread starts in "Single-Threaded Apartment" (This cannot be changed once started)
I would expect that if you highlighted sections of code and ran them, you will remain in STA mode.
If you ran the script from within VSC, you would remain in STA mode.
Extension version: 2020.1.0
VS Code version: Code - Insiders 1.43.0-insider (595f98455be0aac7372a0ae7841efae9b91b848e, 2020-02-18T13:52:42.988Z)
OS version: Windows_NT x64 10.0.18363

@ghost ghost added the Needs: Triage Maintainer attention needed! label Feb 18, 2020
@rjmholt
Copy link
Contributor

rjmholt commented Feb 18, 2020

This is a duplicate of #1470.

It turns out the VSCode API makes this easy for us, so it should be possible to do

@rjmholt rjmholt added Resolution-Duplicate Will close automatically. and removed Needs: Triage Maintainer attention needed! labels Feb 18, 2020
@PeterHodges15
Copy link
Author

Great. If you get it in, I will get latest, build and test it out.

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Feb 18, 2020
@rjmholt
Copy link
Contributor

rjmholt commented Feb 18, 2020

If you get it in, I will get latest, build and test it out.

It's currently marked as up-for-grabs, but I'll see if I can look into it later in March

@TylerLeonhardt TylerLeonhardt removed the Needs: Maintainer Attention Maintainer attention needed! label Feb 18, 2020
@ghost
Copy link

ghost commented Feb 19, 2020

This issue has been marked as duplicate and has not had any activity for 1 day. It has been closed for housekeeping purposes.

@ghost ghost closed this as completed Feb 19, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Duplicate Will close automatically.
Projects
None yet
Development

No branches or pull requests

3 participants