Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Never ending loop to trying to activate extention when trying to run PS script #5045

Closed
jason-collab opened this issue Sep 16, 2024 · 11 comments
Labels
Needs: Maintainer Attention Maintainer attention needed!

Comments

@jason-collab
Copy link

Type: Bug

Even with simple scripts, the PowerShell extension does't appear to ever fullly activate...just loops. VSC and all extensions are up to date. It even occurs for a simple script like as follows:

Connect-MicrosoftTeams
Get-CsOnlineUser -Identity

Extension version: 2024.2.2
VS Code version: Code 1.93.1 (38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40, 2024-09-11T17:20:05.685Z)
OS version: Windows_NT x64 10.0.19045
Modes:

System Info
Item Value
CPUs 13th Gen Intel(R) Core(TM) i7-1365U (12 x 2688)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 15.64GB (4.00GB free)
Process Argv --crash-reporter-id 0f61217d-3470-41e0-8842-8e86025f25a9
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
vscaat:30438848
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
welcomedialogc:30910334
pythonnoceb:30805159
asynctok:30898717
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
accentitlementst:30995554
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
01bff139:31013167
a69g1124:31058053
dvdeprecation:31068756
dwnewjupytercf:31046870
impr_priority:31102340
refactort:31108082
pythonrstrctxt:31112756
flightc:31134773
wkspc-onlycs-t:31132770
wkspc-ranged-t:31125599
pme_test_c:31118331
ei213698:31121563
iacca2:31138163

@jason-collab
Copy link
Author

image

@JustinGrote
Copy link
Collaborator

Thanks for the submission! Could you submit us some logs so maybe we can see something? Have you also tried disabling your profile in the settings?

@jason-collab
Copy link
Author

jason-collab commented Sep 16, 2024

I apologize, I mainly use VSC for running PowerShell...so I'm not very familar with all the configuration settings for it. I have attached a few of the logs...hopefully that can help. Thanks!
PowerShellEditorServices-25812.log
vscode-powershell.log
StartEditorServices-25812.log

Just to clarify, I have no problem copying the body of a script from the Editor Panel and pasting into the Terminal Panel tab on the bottom...it runs fine that way. It just seems like the extension service is having trouble initializing and connecting to VSC so it won't run that script if I choose if from the Side Bar/Explorer and press the run button.

@SydneyhSmith
Copy link
Collaborator

@jason-collab do you have a powershell profile? Can you clarify how did you start the extension? Do you have trouble with any other extensions? Thanks!

@SydneyhSmith SydneyhSmith added the Needs: Author Feedback Please give us the requested feedback! label Sep 17, 2024
@jason-collab
Copy link
Author

Nope...I don't have a PowerShell profile. I just run the default. Here is my VSC settings.json:
image

I usually just need to launch VSC, click on a script in the side bar explorer, and press the run button. For about the past month or so, the PowerShell extension just won't fully activate. It just keeps initializing. So, I have been resorting to copy/paste into the Terminal panel of VSC at this point. I haven't had any trouble with other extensions. I even tried the Start Extension Bisect suggestion in this article and it only finds a problem with the PowerShell extension.

@github-actions github-actions bot added Needs: Maintainer Attention Maintainer attention needed! and removed Needs: Author Feedback Please give us the requested feedback! labels Sep 17, 2024
@JustinGrote
Copy link
Collaborator

@jason-collab I'm not seeing anything in the logs, looks pretty normal, not sure what it would be hanging on. Have you tried starting a new vscode fresh profile with no settings or extensions specified, only install the PS extension, and see if it reoccurs there (don't log in to sync settings either into that profile)

https://code.visualstudio.com/docs/editor/profiles

@jason-collab
Copy link
Author

Same issue. I created a new empty provide, added only the PowerShell extension, then tried to run a script...but same issue.
image

@JustinGrote
Copy link
Collaborator

Does the same occur on another computer? I unfortunately cannot reproduce this in any combination and without a solid reproduction we have no way of knowing how to fix it.

@JustinGrote JustinGrote added Needs: Author Feedback Please give us the requested feedback! and removed Needs: Maintainer Attention Maintainer attention needed! labels Sep 24, 2024
@jason-collab
Copy link
Author

jason-collab commented Sep 25, 2024

Well, I know that our organization implemented BeyondTrust about 6 months ago...but I don't know anything about it. Any idea if that could be causing the issue? I wouldn't think so since I can still run PowerShell from the VSC terminal. But could that be hanging up the extension perhaps?

@JustinGrote
Copy link
Collaborator

JustinGrote commented Sep 25, 2024

Certainly these kind of intermittent or "immediate death" issues can be caused by antivirus and other products seeing pwsh.exe as a threat and halting the execution. Would have to check the logs of the relevant products to be sure.

@github-actions github-actions bot added Needs: Maintainer Attention Maintainer attention needed! and removed Needs: Author Feedback Please give us the requested feedback! labels Sep 25, 2024
@jason-collab
Copy link
Author

Well, I found this #3077. Although it is not the exact same issue, I tried to run VSC as administrator and it finally worked for me now. I never had to do that before. So, I'm guessing BeyondTrust is causing some kind of problem there. However, for the sake of time, I'm not going to go down the rabbit hole of trying to find out why. It looks like that could be pretty time consuming. I'll just run as administrator from now on. Thanks for help @JustinGrote 👍 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Maintainer Attention Maintainer attention needed!
Projects
None yet
Development

No branches or pull requests

3 participants