Did Windows 11 break Visual Studio Code - powershell

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).

Related

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.

Can I debug ActiveDirectory with Visual Studio Code PowerShell extension?

It looks like the Visual Studio Code PowerShell extension is only able to debug scripts running on PowerShell Core.
Is it possible to debug PowerShell scripts when running PowerShell 5.1? I need to debug scripts accessing Active Directory.
On Windows, yes.
https://code.visualstudio.com/docs/languages/powershell#_multiversion-support
TL;DR: Just click the version number in the lower-right corner.

vs 2015 and vs 2017 powershell interactive window hangs

Installed powershell tools for visual studio, but the powershell interactive window hangs with this message:
'Please wait while the PowerShell host is initialized. This may take a few moments..."
Tried setting the ExecutionPolicy for powershell, but does not work.
The weird part is, I have visual studios installed on a personal laptop and the powershell interactive window works fine. It's my work computer that it's not working on.
Not sure if it's something to do with it being on a network, network security of some kind or what?

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.