Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Cannot load PSReadline module #10

Closed
ZoeyR opened this issue Aug 10, 2017 · 6 comments
Closed

Cannot load PSReadline module #10

ZoeyR opened this issue Aug 10, 2017 · 6 comments
Labels

Comments

@ZoeyR
Copy link
Contributor

ZoeyR commented Aug 10, 2017

From @AArnott on July 26, 2017 5:7

When I opened the terminal tool window for the first time, I saw this error:
image

Copied from original issue: ZoeyR/WhackWhackTerminal#4

@ZoeyR ZoeyR added the bug label Aug 10, 2017
@ZoeyR
Copy link
Contributor Author

ZoeyR commented Aug 10, 2017

I have not been able to reproduce this issue, is PSReadLine an external module? If so it could be an issue where the powershell we launch uses some different profile settings. I have had success loading posh-git so I know now all modules are affected.

@ZoeyR
Copy link
Contributor Author

ZoeyR commented Aug 10, 2017

From @Tyriar on August 3, 2017 5:25

This happens when you run the 32-bit version of powershell.exe on a 64-bit machine. If Visual Studio is a 32-bit executable you want to launch %windir%\Sysnative\WindowsPowerShell\\v1.0\\powershell.exe. If Visual Studio is a 64-bit executable, you want to launch %windir%\System32\WindowsPowerShell\\v1.0\\powershell.exe.

@ZoeyR
Copy link
Contributor Author

ZoeyR commented Aug 10, 2017

From @thomaslevesque on August 3, 2017 23:27

I got the same error. Also, it doesn't seem to execute my PS profile, and if I try to execute it manually, I get this error:

PS D:\Git\FakeItEasy> . $PROFILE
. : File C:\Users\Tom\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 cannot be
loaded because running scripts is disabled on this system. For more information, see
about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.

But my execution policy is "Unrestricted"...

EDIT: @Tyriar's explanation is correct. My execution policy for 64-bit PS was Unrestricted, but for 32-bit PS it was still Restricted, because I never use it... To fix, run Powershell (x86) as admin and run Set-ExecutionPolicy Unrestricted

@ZoeyR
Copy link
Contributor Author

ZoeyR commented Aug 10, 2017

@thomaslevesque you could also add the -Scope CurrentUser flag to run the Set-ExecutionPolicy command in the integrated terminal. That way you don't need admin privileges. I would love to be able to avoid all these issues entirely but I'm limited by the fact that the node runtime VS gives me is 32bit.

Edit: just read @Tyriar's response in its entirety, guess I could set the program to execute the 64bit powershell by default.

@ZoeyR
Copy link
Contributor Author

ZoeyR commented Aug 10, 2017

From @Tyriar on August 4, 2017 1:32

@dgriffen that's the solution I landed on. Look here for how to set the right default https://github.com/Microsoft/vscode/blob/a7c10fea150543ac0d159c08751f24899d8b8131/src/vs/workbench/parts/terminal/electron-browser/terminal.ts#L17

We're actually experiencing the opposite problem right now where we've been advising to use Sysnative for over a year and now there's a 64-bit build which won't work at all with a Sysnative path (just wrote a blog post about it). So now we're just forcing System32 when Wow64 is active https://github.com/Microsoft/vscode/blob/a7c10fea150543ac0d159c08751f24899d8b8131/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts#L160

@ZoeyR
Copy link
Contributor Author

ZoeyR commented Aug 11, 2017

Closed by #4

@ZoeyR ZoeyR closed this as completed Aug 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant