I am experiencing a problem with PowerShell extension. I have checked issue #752 and I am confident that the fixes in that bug report are applied.
The PowerShell extension hangs when the second terminal (PowerShell Integrated Console) starts. It never times out and it never crashes, it just stays stuck at "Starting PowerShell..."
I have noticed the issue on another PC in my org so I am wondering if it is an issue with our image build with our laptops but... I can't get anything to show in the logs, so I am stuck trying to figure out what is hanging the extension up.
I enabled diagnostic mode but it doesn't seem to have caught any additional info.
Start-EditorServices-EditorServices.log
vscode-powershell.log
EditorServices.log
1.29.1
bc24f98b5f70467bc689abf41cc5550ca637088e
x64
| Name | Version |
| --- | --- |
| Operating System | Windows 10 1709|
| VSCode | 1.29.1|
| PowerShell Extension Version | 1.9.0 |
PS C:\Scripts\Git-Repo\PS-ADHeath> $psversiontable
Name Value
---- -----
PSVersion 5.1.16299.666
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.16299.666
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
AlanWalk.[email protected]
CoenraadS.[email protected]
formulahendry.[email protected]
gerane.[email protected]
in4margaret.[email protected]
jprestidge.[email protected]
mdickin.[email protected]
ms-vscode.[email protected]
ms-vscode.[email protected]
PKief.[email protected]
shd101wyy.[email protected]
streetsidesoftware.[email protected]
yzane.[email protected]
yzhang.[email protected]
Can you change the "powershell.developer.editorServicesLogLevel" setting to Diagnostic in your user settings and repro this again and attach that EditorServices.log file? That should provide a lot more detail during startup.
Hi @rkeithhill
I had enabled that prior to the first upload. I just went back through the logs and can't find anything that jumps out. I am going to attach two zips: the last two launches of VSCODE in case I am missing something really obvious.
{
"editor.minimap.enabled": false,
"window.zoomLevel": 0,
"workbench.colorTheme": "Blackboard",
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"powershell.powerShellExePath": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"files.associations": {
"*.ps1": "powershell"
},
"powershell.enableProfileLoading": true,
"editor.renderWhitespace": "none",
"editor.renderControlCharacters": true,
"files.trimTrailingWhitespace": true,
"breadcrumbs.enabled": false,
"powershell.integratedConsole.showOnStartup": false,
"powershell.developer.editorServicesLogLevel": "Diagnostic"
}
1543850094-c1b1601a-e9ac-4afd-afe2-46fa771a60f31543850083161.zip
1543854564-4b234fa9-b485-4a84-af31-946de20c890b1543854525112.zip
Doh! Not much of anything to go on there. Can you check the EventViewer on Windows. See if there is any error related to PowerShell in the Application log around the time it crashes/terminates. If you see nothing there, check the Windows PowerShell log here:

I'll check now... the problem is that I don't think the extension ever crashes. it just sits at starting PowerShell, the only real issue I have noticed is not being about to debug.
Looking at Event Viewer now...

nothing in the logs other informational stuff. :( Frustrating how little I have to go on here.
@compwiz32 Is the device you are using, restricted or locked down in anyway, for example with Group Policy?
We are also releasing a new version of the extension this week, lets see if that helps this problem at all
@SydneyhSmith My hunch going into opening this thread was that, yes, my issue is environment specific. Yes, I have a decent amount of GPO's and defense industry lock-downs (but not too bad). I am cool waiting for the next version.
However, I am frustrated that I can't seem to generate an error that would point me in the direction of where the error may lie. Other than switching from diagnostic to verbose logging, anything else I could try to possibly highlight where my issue may be?
If you're able to edit the Start-EditorServices.ps1 script (should be at $HOME\.vscode\extensions\ms-vscode.powershell-1.9.0\modules\PowerShellEditorServices\Start-EditorServices.ps1) you might be able to put $ErrorActionPreference = 'Stop' at the top. That script imports the PowerShellEditorServices module, uses Add-Type to bring in the required DLLs for the platform, and calls the entry API to start EditorServices within the PowerShell process it starts up. You can find all those bits here.
If you can see any other possibilities for logging in Start-EditorServices.ps1, let us know as well.
I've seen one or two of these mysterious failures now, where I'm really not sure what's causing the issue. The fundamental problem is that we have a client/server architecture, so when the server doesn't reply, the client doesn't know what's failed.
Another thought I've had: it may end up that the script is not "failing" just blocked forever on something. If so, it might be possible to put a Wait-Debugger in the top of the script and then step through one line at a time in the Integrated Console with s.
@compwiz32
This looks sort of similar to when something is blocking nodepty.exe. Are you able to specify which anti-virus you are using? I know someone reported needing to white list it within McAfee, though that may have been an internal rule set.
I do have same problem with PowerShell Extension in VSCode. At first, the editor would not start because it could not find 'api-ms-win-core-sysinfo-l1-2-0.dll' - I found a workaround - see #1633
If a debug session run until end of script, the debugger will not start on 2nd run. If I break and stop the debug session, then a 2nd debug session works fine.
The problem starts this morning after reload of vscode to
Version: 1.29.1 (system setup)
Commit: bc24f98b5f70467bc689abf41cc5550ca637088e
Date: 2018-11-15T19:13:36.375Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64
I have tried the Debug open new session as mentioned above.
I get the error:
12/6/2018 11:23:33 AM [ERROR] - The language service could not be started:
12/6/2018 11:23:33 AM [ERROR] - Timed out waiting for session file to appear.
I have exactly same problem since 1.10 update. Didn't had this problem before. Did you already found any solution/workaround or we need to wait until next release?
Can everyone here try this workaround:
https://github.com/PowerShell/vscode-powershell/issues/1633#issuecomment-444814977
See https://github.com/PowerShell/vscode-powershell/issues/1633#issuecomment-444955893 for the DLL to download
@compwiz32
This looks sort of similar to when something is blocking
nodepty.exe. Are you able to specify which anti-virus you are using? I know someone reported needing to white list it within McAfee, though that may have been an internal rule set.
My A/V: Symantec AV
I took a good look through the AV logs and don't see anything pointing to a file block.
FYI - v1.10.0 made no difference for me and I did import the new DLL listed in #1633 as directed by @TylerLeonhardt
I am working through @rjmholt suggestions now re ErrorAction Stop and Wait-Debugger. I'll comment after testing. I also believe that this probably a case of "just blocked forever on something" rather than a bug.
@rjmholt
I found a workaround that has temporarily solved my issue... I went back to the system version of VSCODE and success!!!
So this tells me that we have a permissions issue somewhere. Our laptops have some "unique" lockdowns so I am not sure how to troubleshoot that... Any ideas?

@compwiz32 That's excellent. I'm following up now to see if there are any ways in general to do something like turn one of these hangs into a crash or something similar.
@rjmholt
Maybe I can save you some time. I know of issues we have had in the past due to security requirements that block us from interacting with the "Windows Store". If you can think of any reason why VScode may be waiting for an answer from an online MS service, that may be the issue here.
I say that knowing that there should not be any talk to an online service just to load a language but throwing it out there as a remote possibility. I will put into place whatever you might come up with for a future test.
So after looking into this, it looks like there are a couple of avenues to explore:
Can I run the user and system versions side by side? I uninstalled the user version to make sure the system version didn't step on or pick up "old bits of code"
Looks like side-by-side is possible although you might get warnings about it.
For me nothing helped. I tried all kind of things and I was already running system version. I tried also user version but same issue with 1.10 version. I finally gave up and uninstalled 1.10 and returned back to 1.9 which works perfectly fine. If you have any updates please inform me so I can test.
I had the same problem and noticed that I had a deleted folder in my vscode workspace. After I removed this folder from the workspace everythin was working fine.
Hello gents... i am back again...
I am still suffering from this issue.... It went away after a system install months ago and then came back a very short while after (like maybe next reboot). I was just dealing with it until I got fed up today. I reinstalled the user version and I am still hung at "Starting PowerShell..." I am attaching the editorservices.log and the vscode-powershell.log files with the hope that maybe they will reveal something i haven't noticed, but there isn't much in there...
vscode-powershell.log
EditorServices.log
Start-EditorServices-EditorServices.log
I am wondering if there's a permissions issue where the pipe points to. Is there a way to figure out where a pipe is on my machine?
Just found this thread, I'm running into the same problem on my work machine. It seems to hang on the line
3/22/2019 3:27:02 PM [NORMAL] - Connecting to language service on pipe \\.\pipe\PSES_untqesdw.qj4...
Also, my PowerShell window pops out (it's not integrated). This was working when I first tried it, but stopped a few hours later. It's a shame because this extension is extremely useful for my PowerShell development.
@compwiz32 I was able to solve my problem by installing PowerShell Core (https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-6) with administrator permissions and then changing the Power Shell Exe Path in vscode to point to it.
It now starts up correctly! Maybe this will work for you as well :)
@zachmerrill so are you saying you installed PSCore and then in VSCODE pointed the PS executable path to PSCORE PS Exe ?
Just very interesting but I wonder what changes for your everyday PS experience?
@compwiz32 Correct. I now have two versions of PowerShell installed (PSCore and the version preinstalled on my system). I only use PSCore for the VSCode extension, so it shouldn't affect my day to day too much.
Here's the things I tried if you're interested...
Start-EditorServicesHost.ps1 but this didn't have any effect. Start-EditorServicesHost.ps1 manually in a terminal and got the following error:The specified module 'PowerShellEditorServices' was not loaded because no valid module file was found in any module directory.Good luck :)
After discussing this a bit more, it seems that different people reporting this issue have different configurations and may not all be experiencing the same problem.
Certainly it seems like there may be a problem with the User-version of VSCode -- so for now I'd recommend trying the system version.
Given that this seems to be machine-setup specific but that we've been unable to reproduce it ourselves, I think the best way forward at this point is:
@rjmholt
@TylerLeonhardt
ok... I am sort of embarrassed to share what has worked for my issue. First, a little background...
Just set up a new laptop that I had been using as a demo machine for summit as my everyday laptop at work. everything worked fine when it was not domain joined. But I ran into the same issue as the old laptop (hung up on "Starting PowerShell") as soon as I domain joined the laptop. I assumed at first that if I had the problem again, it would be something like Anti-virus, etc that would be the cause. However, I started getting the issue again before I finished installing all my apps on the laptop.
Started thinking about what was going on here and had a thought...
Did I ever try running VSCODE by right-clicking and running as administrator? No, I haven't... so I gave that a whirl and my "Starting PowerShell" issue does not occur if I select RUN AS ADMINISTRATOR. I tried this with the system and user installs of VSCODE and got the same results both ways.
The only reason I thought to try Running As Administrator was because I had to do that like 10x today setting software up on the new laptop. Otherwise, I don't normally need to run apps that way...
So the question is why?
My guess is that my corp locked down the environment and we must have a security setting in place that is preventing the PowerShell terminal from creating a temp file or something along those lines due to non-elevated status. To eliminate having to right click and run each time, I browsed to the EXE and checked off the "run as administrator" checkbox under compatibility just to save me some clicks... and so I could call the EXE if need be and have it run correctly.
I am going to test this on my old laptop which is also domain joined and suffering the same issue but I can't do that until I return to the office. I'll follow up after testing on the old laptop.
Just tested this on my old laptop and my suspicions have been confirmed. Running VSCODE as Administrator solved the issue on my old laptop as well. Again, i did not need to do this on a standalone desktop. I only had to do this once I joined my company's domain. This leads me to believe that we locked down some settings that interfere with the starting of the PowerShell extension.
I found that Comodo Internet Security Premium was creating this issue for me. It can be corrected by going to Settings -> Advanced Protection -> Script Analysis, then find powershell.exe in the list and toggle off Heuristic Command-Line Analysis -> click OK.
Hope this helps!
This leads me to believe that we locked down some settings that interfere with the starting of the PowerShell extension.
@compwiz32 I know it's been a while, but if you were able to identify what settings were causing this, that might help us to fix the underlying problem here
Hi *,
The hot tip from @compwiz32 of installing the latest Powershell version worked for me. I already had Powershell 6.0 installed and was experiencing the hanging intergrated terminal issue.
I closed VS Code & installed Powershell 7.0 restarted VS Code & all is working now for me.
So it would appear that installing Powershell again straightens something out that the Extension bends. Just for the Brains among you, upon uninstalling the PowerShell preview extension, also resolved the problem, but of course I did not have the all singing & dancing integrated terminal any longer.
Thanks for the Tip
Porky
This leads me to believe that we locked down some settings that interfere with the starting of the PowerShell extension.
@compwiz32 I know it's been a while, but if you were able to identify what settings were causing this, that might help us to fix the underlying problem here
@rjmholt I wish i knew what the issue was.... but i don't have any more info to share on that issue.
I had the same issue and found the installing extension version back to v2020.1.0 solves the issue but cannot use the latest v2020.6.0
Even I had the same problem with the extension version. Downgrading to v2020.1.0 helped me! 馃憤
Hi everyone. I just wanted to mention that I solved this by installing PowerShell 7.1, so that VS code "booted" with 7.1 and then I switched back to 5.1 and it worked fine.
FYI previous advice from @kristianBirkThim worked for me too. I believe the problem started after upgrading to 1.51.1 with extension version 2020.6.0.
I was able to resolve this issue by upgrading from PowerShell Core 6 to 7, but it was a lucky guess. The error reporting and resiliency still need a lot of work.
Sorry but I'm still having this issue. At first it seemed like it went away after formally installing PowerShell 7.1, then switching back to 5.1, but I can't seem to completely shake it. Seems like it particularly occurs when I'm using a second or third window. However it's not consistent. I just updated to 1.53 and that seemed to fix it for the 2 windows I had, but I just opened a 3rd and it's back. Sometimes I'm able to get out of the "Starting PowerShell..." state by switching the version in the runtime config, but it still a pain.
Most helpful comment
I had the same issue and found the installing extension version back to v2020.1.0 solves the issue but cannot use the latest v2020.6.0