Skip to content

2019.9.0 Will not load if C:\Program Files\PowerShell Exists #2239

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

Closed
andyhoffman12 opened this issue Oct 10, 2019 · 2 comments
Closed

2019.9.0 Will not load if C:\Program Files\PowerShell Exists #2239

andyhoffman12 opened this issue Oct 10, 2019 · 2 comments
Labels
Resolution-Duplicate Will close automatically.

Comments

@andyhoffman12
Copy link

System Details

System Details Output

& {"### VSCode version: $(code -v)"; "`n### VSCode extensions:`n$(code --list-extensions --show-versions | Out-String)"; "`n### PSES version: $($pseditor.EditorServicesVersion)"; "`n### PowerShell version:`n$($PSVersionTable | Out-String)"}
### VSCode version: 1.39.0 9df03c6d6ce97c6645c5846f6dfa2a6a7d276515 x64

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


### PSES version:

### PowerShell version:

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

Issue Description

Probably Duplicate of #2217

The powershell extension is not loading on my workstation. Uninstalling both the extension and vscode + removing the extension files from disk and reinstalling does not resolve.

After some troubleshooting I determined that if C:\Program Files\PowerShell\ exists it will block the extension from loading. I suspect that this was due to the fact that on my system I previously had powershell core 6.0 installed but removed due to other issues ( I primarily write for windows 7/2008r2 machines). That removal left behind the C:\Program Files\PowerShell\ directory, Core was uninstalled a long time ago, 6+ months, and the extension had been working fine at that time..
When the error began around the release of 2019.9.0 I noticed the problem but didn't analyze at the time. This issue does not occur with 2019.5.0 in my testing. (rolling back the extension using VSCode). Updating back to 2019.9.0 causes this issue to return.

Expected Behaviour

Edit a powershell file and the integrated console loads

Actual Behaviour

Opening a .ps1 file nothing happens. No console loads and the indicator at the bottom right never changes and the powershell version icon is not present.
Pressing F5 results in:
'Cannot debug or run a PowerShell script until the PowerShell session has started. Wait for the PowerShell session to finish starting and try again.'
No amount of waiting will resolve this issue, and again no typical activity of Initializing... appearing in the lower right.

Attached Logs

logs from the Developer tools from vs code

abstractExtensionService.ts:396 Activating extension 'ms-vscode.powershell' failed: Cannot read property 'exePath' of undefined.
_logMessageInConsole @ abstractExtensionService.ts:396
console.ts:137 [Extension Host] Activating extension `ms-vscode.powershell` failed:  Cannot read property 'exePath' of undefined
t.log @ console.ts:137
console.ts:137 [Extension Host] Here is the error stack:  TypeError: Cannot read property 'exePath' of undefined
	at Object.getDefaultPowerShellPath (c:\Users\AndrewHoffman\.vscode\extensions\ms-vscode.powershell-2019.9.0\out\src\platform.js:76:59)
	at SessionManager.getPowerShellExePath (c:\Users\AndrewHoffman\.vscode\extensions\ms-vscode.powershell-2019.9.0\out\src\session.js:239:26)
	at SessionManager.start (c:\Users\AndrewHoffman\.vscode\extensions\ms-vscode.powershell-2019.9.0\out\src\session.js:84:39)
	at activate (c:\Users\AndrewHoffman\.vscode\extensions\ms-vscode.powershell-2019.9.0\out\src\main.js:133:24)
	at Function._callActivateOptional (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:667:613)
	at Function._callActivate (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:667:264)
	at T._doActivateExtension.Promise.all.then.n (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:666:404)

vscode-powershell.log

EditorServices.log

@ghost ghost added the Needs: Triage Maintainer attention needed! label Oct 10, 2019
@rjmholt
Copy link
Contributor

rjmholt commented Oct 10, 2019

Thanks for opening this @andyhoffman12. You're correct that this is a duplicate of #2217

@rjmholt rjmholt added Resolution-Duplicate Will close automatically. and removed Needs: Triage Maintainer attention needed! labels Oct 10, 2019
@ghost
Copy link

ghost commented Oct 11, 2019

This issue has been marked as duplicate and has not had any activity for 1 day. It has been closed for housekeeping purposes.

@ghost ghost closed this as completed Oct 11, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Duplicate Will close automatically.
Projects
None yet
Development

No branches or pull requests

2 participants