Visual Studio 2019 Developer PowerShell v16.9.4 not working - powershell

I have an issue or question with regards to Visual Studio 2019 Developer PowerShell v16.9.4.
I have Visual Studio Professional 2019, Version 16.9.4.
When I right click on my Solution and select Open in Terminal then Visual Studio 2019 Developer PowerShell v16.9.4 opens... but it doesn't allow me to put/execute any command son it.
My impression is that it's not fully loaded or something...
By contrast if I open Visual Studio 2019 Developer Command Prompt as you can see from the image bellow: v16.9.4 I'm able to execute commands on it.
And this is what happens with the PowerShell
Note: I know there's the settings options but I haven't modified anything yet there.
Am I missing somthing or someone else could point me in the right direction to make it work?

I have solved or found a workaround.
In my initial post, I did mention that I knew that there was a settings option but I haven't done anything there ... yet.
Finally, I solved going in that direction.
So, just in case someone else faces the same or similar situation.
My built-in Developer PowerShell (inside Visual studio) is configured as follows:
shell location: C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe
Arguments: -NoExit -Command "& { Import-Module $env:VSAPPIDDIR\..\Tools\Microsoft.VisualStudio.DevShell.dll}; Enter-VsDevShell -SkipAutomaticLocation -SetDefaultWindowTitle -InstallPath $env:VSAPPIDDIR\..\..\
So, I created a new Developer PowerShell settings called: "Sebas PowerShell" (quite original 🤣) and with the following settings (fewer arguments):
shell location: same location pointing to powershell.exe
Arguments: -NoExit
Like this, it works perfectly fine.
So, I guess it might be related to DevShell.dll or to the other arguments.
In any case, now I can use the Developer PowerShell inside Visual Studio 😀

I know this is a bit late, but I have found that if you have a project selected in Solution Explorer and then choose Open In Terminal, it works fine. If you have any other node selected, the Powershell window opens, but you can't type anything.
No need to create new settings.
Makes sense I suppose, as the point of the terminal is to run commands related to a specific project.
Hope that helps.

Related

How to change integrated PowerShell terminal in VS Code

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.

PowerShell 5.1 in Visual Studio code behaves strangly

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

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.

Is there a Tools option on Visual Studio Code under Ubuntu?

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.

Can I get intellisense in powershell?

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