Vscode-powershell: VS Code "powershell.developer.powerShellExePath" not changing path to executable

Created on 17 Sep 2016  路  9Comments  路  Source: PowerShell/vscode-powershell

Please fill in these details so that we can help you!

System Details

  • Operating system name and version: Windows Server 2016 TP5
  • VS Code version: 1.5.2
  • PowerShell extension version: PowerShell 6.0.0-alpha.10
  • Output from $PSVersionTable: See attached image.

Please see attached image.
vscodeposhpathissue

Evaluate $PSVersionTable in PowerShell and paste the output here

Issue Description

I'm not able to change PowerShell executable path to point to ver. 6.0.0.10:
"C:/Program Files/PowerShell/6.0.0.10/PowerShell.exe" in "settings.json" file.

Following instructions on link: https://github.com/PowerShell/PowerShell/blob/master/docs/learning-powershell/using-vscode.md

In VS Code Output panel $PSVersionTable results stills shows: PSVersion 5.1.14300.1000.

I'm using the "Code Runner" extension.

Attached Logs

Log files attached!
1474148131-PowerShelllog.txt
1474148131-EditorServiceslog.txt

Follow the instructions in the README
about capturing and sending logs.

Most helpful comment

The best option for simple script evaluation is to select some text and press F8. We've got a crude interactive console support which doesn't let you type commands but you can evaluate selections in your script. You can type $PSVersionTable into your file, select it, then hit F8 to see the version info of the PowerShell edition you're running in.

The next major release of the PowerShell extension (0.8.0) should have full interactive console support to bring VS Code closer to the ISE development experience. Hoping to get that out in early October!

All 9 comments

The "Code Runner" extension isn't owned by us and doesn't use this setting. If you check the PowerShelllog.txt you'll see that the PowerShell extension is indeed using the PowerShell exe path that you specified. You can also see this in the Editor Services log:

    PowerShell runtime version: 5.0, edition: Core

Maybe the "Code Runner" extension has its own setting?

Hi David,

I could find any custom settings for PowerShell.

So, what's the VS Code way to run and see the results of a PowerShell script? How can I verify that's executing the changed execute path?

I find "Code Runner" practical but that's because I'm trying understand VS Code environment settings.

Any hints?

Greatly Appreciated,
Max

In the current version, the output from your script is displayed in the debug console. You can open the debug console by pressing the little terminal icon in the upper-right part of the Debug tool window. Or on Windows press Ctrl+Shift+Y.

The best option for simple script evaluation is to select some text and press F8. We've got a crude interactive console support which doesn't let you type commands but you can evaluate selections in your script. You can type $PSVersionTable into your file, select it, then hit F8 to see the version info of the PowerShell edition you're running in.

The next major release of the PowerShell extension (0.8.0) should have full interactive console support to bring VS Code closer to the ISE development experience. Hoping to get that out in early October!

That's Great! Thanks for your quick response. I was going to showcase this on my PowerShell User Group on Sept.29th with lots of other goodies.

Thanks again,
Maximo Trinidad
:)

Thanks Keith!

please release the binary flatpak format (so that one can install it across linux distributions and also without administrative access)
as of now, releasing only in .deb and .rpm format forces one to install in global admin places with admin rights mode only.

please see http://www.flatpak.org for details

Hey @zaxebo1, this would be better as a request to the Visual Studio Code team since our extension gets installed as part of that. It seems that another user has already filed this request there, so they're aware of it already: https://github.com/Microsoft/vscode/issues/7112

I think this issue is resolved now, right? I'll close it for now, happy to reopen if there's still a lingering issue. Thanks!

Was this page helpful?
0 / 5 - 0 ratings