vscode-powershell icon indicating copy to clipboard operation
vscode-powershell copied to clipboard

Integrated Powershell Hangs on Get-Credential

Open ErvM opened this issue 5 years ago • 9 comments

System Details

### VSCode version: 1.33.0 0dd516dd412d42323fc3464531b1c715d51c4c1a x64

### VSCode extensions:
[email protected]
[email protected]
[email protected]


### PSES version: 1.12.0.0

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      5.1.17763.316
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.316
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

System Details Output


Issue Description

I am experiencing a problem when I am running my script, everytime I do a Get-Credential to login to Office365, it will hang on me. Now I want to say this was working before but for some reason it is not working now. I can copy parts of my script and put it in a new file and run it, and it will work. I have even tried just copying the text to a new file and saving it as something different, but still the issue persists.

Expected Behaviour

-- In Powershell ISE, it will ask me for credentials in a Credentiaol GUI window, In VSCode it will only ask for them in the terminal, but both are successful and work, well VSCode is successful when its not in my entire script.

Actual Behaviour

-- In VSCode it asks me for my password in the terminal, but wont let me type it in and just hangs.

Video_2019-04-10_133812

Attached Logs

EditorServices.log Start-EditorServices-EditorServices.log vscode-powershell.log

ErvM avatar Apr 10 '19 16:04 ErvM

Attached is my script, I think I took anything sensitive out :/

Alpha Admin Tool - Copy.txt

ErvM avatar Apr 10 '19 16:04 ErvM

I can confirm this happens on latest insiders vscode with Preview extension. I have no reason why, Fluent Terminal and conemu with credential's captured in terminal don't have this issue. Ditto for Integrated Terminal provided by vscode.

PSIC seems to be the cause, but that's about as far as I've been able to determine.

Ninja Edit to add:

@ErvM if you click the trash icon above the console, it will kill the session and prompt you to restart. You can also click the 5.1 in the status bar and opt to restart current session.

corbob avatar Apr 11 '19 18:04 corbob

I have even taken out a part of my script that calls the function that does the Get-Credential and starts a PSSession, and that works 100%, I have tried so many things to see what could be causing it, its driving me mad!

--Reply to the Ninja Edit! I cant believe I didn't see that trashcan, that indeed kills it! Thanks for that!

ErvM avatar Apr 11 '19 19:04 ErvM

@ErvM sorry that you are hitting this, thanks for reporting the issue! We will try to investigate the cause.

SydneyhSmith avatar Apr 11 '19 21:04 SydneyhSmith

I confirm i have the same problem. Windows 7 Pro x64 Powershell 5.1 Visual Studio Code 1.36.0 PowerShell Language Support for Visual Studio Code 2019.5.0

I add Get-Credential into AddClick Button.

YohannJourniac avatar Jul 08 '19 12:07 YohannJourniac

@SydneyhSmith any update? also ran into this problem

bgsz avatar Apr 28 '21 12:04 bgsz

I'm having this issue even in powershell terminal. running Get-Credential gives me the dialog window, but after that powershell freezes. I can't even force close the process (access denied)

Selman555 avatar May 07 '21 18:05 Selman555

This continues to be a problem.

VSCode: 1.63.2 Powershell Extension: v2021.12.0

tibmeister avatar Feb 01 '22 14:02 tibmeister

Have you tried the preview extension? Works fine there for me on both 7.2 and 5.1 image

JustinGrote avatar Feb 01 '22 15:02 JustinGrote

I'm going to assume this is fixed as we haven't heard back from you, thank you!

andyleejordan avatar Oct 18 '22 18:10 andyleejordan

This issue has been marked as fixed. It has been automatically closed for housekeeping purposes.

ghost avatar Oct 18 '22 19:10 ghost