PowerShell / Visual Studio Code: Update version of PowerShell in Visual Studio Code - powershell

I'm using Visual Studio Code v1.37.1 which is using PowerShell v5.1.18362.145. I went to GitHub to attain and install the latest PowerShell (v6.2.2) but, when I run $psversiontable in VS Code, it tells me it's still using the old version.
How do I get VS Code to use the latest PowerShell version I have installed?
Thank you.
PowerShell admin window:

code --install-extension PowerShell-6.2.2.vsix

I found the answer here.
This is the link address: https://4sysops.com/archives/vscode-as-a-console-for-powershell-core-6-part-1-multiple-shells/

As of the latest VS Code, just go to Settings and configure:
terminal.integrated.profiles
Just need to set this to Powershell instead of Default (or the appropriate directory).

Related

VS Code opened via VS Developer Command Prompt not recognizing 'cl'

As the title says, VS Code is not recognizing cl compiler although opened via Visual Studio 2022 Developer Command Prompt:
VS Code terminal:
I have tried using VS Code external terminal with %comspec% /k "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat"
which did not work.
Setting the comspec manualy in the terminal did solve the issue for the terminal instance:
But the C++ extension is still complaining about cl.exe:
cl.exe build and debug is only usable when VS Code is run from the Developer Command Prompt for VS.
I have never used VS Code for C++ before and I don't use windows for development at all so go easy on me.
What could be the reason for the issue and how it can be solved?
Visual Studio Developer Command Prompt must be elevated(run as Administrator) in order to correctly open VS Code with the needed permissions.
Running Visual Studio Developer Command Prompt as Admin solves the issue.
One solution that worked for me is to go directly in the setting for C++ extension and find compiler path setting, and manually set it to cl.exe path on your computer.

Did Windows 11 break Visual Studio Code

I 'upgraded' my Win10 system to Win11. Since then Visual Studio Code simply will not run my PowerShell scripts. What happens is the little 'Pause/Step-x/Restart/Stop' ribbon appears at the top. All I can do then is hit the Stop. I uninstalled & re-installed VS-Code to no avail. I deleted the .vscode folder in my user-profile, again to no avail.
I have both PowerShell 5.1.22000.65 Desktop and 7.1.3 Core installed on this system. VS Code is 1.58.2 (system setup). PowerShell extension is v2021.6.2.
The same scripts run happily in Windows Terminal, PowerShell command window and the ISE.
Any ideas please?
Thanks very much.
Update 13th August 2021: PowerShell scripts are now running as expected in Visual Studio Code.
VS Code is 1.59.0.
PowerShell Extension is 2021.8.0.
The most likely change to have enabled scripts to work again is the update to PowerShell 7.1.4 Core (was 7.1.3).

Ballerina with Visual Studio Code

I am struggling to get Ballerina working with Visual Studio Code (on Windows 10).
It is installed and works fine from Command Prompt, however it cannot complete build command in Visual Studio Code. It does not seem to be able to finish build command effected via Visual Studio Code. I have Ballerina extension for Visual Studio Code installed.
Does anybody had similar problems and know how to overcome it?
Bellow please find details of versions:
Ballerina 1.2.1
Language specification 2020R1
Ballerina tool 0.8.5
VSC:
1.44.2
Ballerina extension for Visual Studio Code
Windows:
10 Pro
Version 10.0.18362
#GregorSind, try quitting the VSCode instance and then reopen. This might be that the environment variables are not being visible to the VSCode instance. Also, check what's the integrated shell of VSCode

Visual Studio Code shortcut for terminal

I simply cannot find an answer by googling, for, what is the command line shortcut that stands for Visual Studio Code. For example to check the version, and I know I can just use its built-in terminal and type --version but what if I want to check that from outside?
It's simply code.
code --version // to check version
code // opens visual studio code

File Not found exception - speechclient.dll NuGet Package

I have a project using the SpeechClient.dll from NuGet. The program runs fine on the development machine. So I have a Windows Setup Project that creates the installer. I run the installer and all the files show up including the SpeechClient.dll, but as soon as the program makes the first call to the Speechclient.dll, I get a
file not found
exception. This is the output from the event viewer.
Does anyone have any troubleshooting ideas? Thanks.
Seems now that I have installed visual studio on the machine that it is working. I wonder what visual studio installs? I was also trying to use Fusion Log Viewer to see what the problem was.
I had this problem as well. Installing the Visual Studio C++ Redistributable 2017 x64 cleared it up.