I'm fairly new to VS Code and I have been trying to setup the program/workspace (one and the same for me).
I've setup all the recommended settings for PowerShell, but I have been trying to change the integrated terminal to v7 - each time it loads is with V5.1.
Firstly, I know there are many answers out there - I have tried them all. The problem is that most of them are out of date now.
I ran into an answer by Ger83 in How to Change Visual Studio Code 'Powershell Integrated Console'?. There, he describes the deprecated features and issues with the PowerShell Extension. (Since Ger83 had the answers, I was going to leave comments - not enough reputation - or send a private message - does not exist - so I had to create a whole new question to get an answer.)
So, is there a way to change the PowerShell integrated console from v5.1 to v7 while also using the PowerShell Extension?
My settings.json, I believe, are setup correctly:
"terminal.integrated.defaultProfile.windows": "PowerShell",
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell"
I tried to turn off the PowerShell extension, but as a result, I lost the ability to run PowerShell scripts from the editor.
With the extension on, I noticed that the language in the bottom-right corner is shown as v5.1. I don't know if it is possible to change this.
PowerShell Language screenshot showing v5.1
If there is no way to change the integrated console to v7, are there any workarounds to enable easy running of a script directly to the PowerShellv7 console? This may be a shortcut or setting.
Edit: Answer is provided by mklement0 in the comments.
When using PowerShell in VS code and working interactivly, often when I highlight some code and run it then it does not print anything in the terminal. Then I simply restart The "PowerShell Integrated Console" (by pushing the trash can) and it then works again.
It is quite annoying. My ADS also acts like this. Is this a general problem with PowerShell with VS Code or is it my computer?
My VS Code version is 1.68.0. My PowerShell version is 5.1.19041.1682. And the version of the PowerShell extension is v2022.5.1
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.
I'm using Visual Studio Code on Ubuntu. I'm new to Linux/Ubuntu so please excuse me if I'm asking a stupid question.
My question is regarding the Tools menu on Visual Studio under Windows. I don't see a Tools option in VS Code and when I search online I see some references to files/tools but that does not seem to work.
I have tried the option to right click the file in both Explorer in VS Code and the system Explorer but the instructions say to select Open in Command Prompt (or Open in Terminal) but those options don't exist when I right click.
Can someone please advise me and give me a reference if it exists?
Maybe an alternative is to run Microsoft VS using Wine. I have not tried that yet as it seems a little like wishful thinking but I will if someone says it will work.
From the Main Menu, select Help, the 'Welcome' which has Customize Tools and Languages.
Edit: Anyone coming to the question now. Please look at the dates. This is a very, very, old question from the first version of PowerShell. Everything is now different
Just starting out with PowerShell, I would love to have intellisense support for writing PowerShell scripts. Tab-completion works great so you would think it would exist somewhere, but the only thing I can find an article from 2007 - hardly up to date.
Is there an extension somewhere that gives you this ability?
How about an editor?
Try this -
http://powergui.org/index.jspa
This is a good editor with intellisense
The Windows PowerShell ISE which is installed with later versions of PowerShell has got built-in intellisense.
Also Visual Studio Code with the PowerShell extension is another option
And ISE Steroids if you want to stay with ISE
But seems direction is VS Code, especially with Core
Have a look on PowerTab.
Also PowerShell Plus (commercial). Or you can wait for PowerShell 2.0 and hopefully get Graphical Windows PowerShell.
PowerSE is a free PowerShell Editor that includes Intellisense (PowerShell, WMI, and .NET)
Features:
Includes Auto-Script creation feature - execute a cmdlet, look at the results in a grid view, select and sort columns, then tell it to generate the PowerShell for you.
Community button to search TechNet and PoshCode for samples.
Debug features such as breakpoints and stepping through code.
Watch window to drill into PowerShell variables.
Context sensitive help.
Imbedded console window with command recorder.
Try visual studio code with powershell extension. It works better than Windows PowerShell ISE for me.
PSReadline now has intellisense right in the console based on the command history. https://devblogs.microsoft.com/powershell/announcing-psreadline-2-1-with-predictive-intellisense/
To enable in powershell 7:
Set-PSReadLineOption -PredictionSource History
You can also get that version of psreadline in powershell 5.1.
Install-Module PSReadLine -RequiredVersion 2.1.0
I think it is the best way that you write TabExpansion.
There are no Autocomplteion tools for posh, like C#'s IntelliSence.
They can't get even $_'s properties even if you use just a standard Cmdlet.
PowerShell ISE v3 has Intellisense
http://www.microsoft.com/download/en/details.aspx?id=27548