-
Notifications
You must be signed in to change notification settings - Fork 511
microsoft store installed powershell can not be recognized #3181
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
Comments
I tried to change "terminal.integrated.shell.windows" as well,but no use |
This happens since updated to Visual Studio Code Version 1.53. |
The logic to automatically pick up a store installation is here: vscode-powershell/src/platform.ts Lines 262 to 290 in 7f0b969
It's not clear why this would suddenly fail, especially due to a VSCode update (since that shouldn't update anything within the extension itself). It's also mysterious why giving an explicit absolute path would also fail -- that's effectively a bypass for the PowerShell-finding logic and should work no matter where it's pointed (as long as that's a valid PowerShell executable). |
So we've now had a second report of this, and I'm wondering if there's a permissions issue or similar going on -- hopefully we can reproduce this locally to investigate |
@rjmholt I can confirm the same behavior here as well. |
So it looks like this is due to vscode-powershell/src/platform.ts Line 494 in ce41617
It's not clear why this previously worked, but either node or Windows/the store has changed its behaviour here (our code hasn't changed since we implemented Store PowerShell detection). We need to update this check to be something like: try {
fs.lstatSync(this.exePath);
this.knownToExist = true;
} catch {
this.knownToExist = false;
} Or alternatively do a readlink operation to resolve the link... |
Fixes #3181. The MSIX exe is a symlink and node's file test API returns false for those. This fixes that so we now detect the PowerShell MSIX installation properly again.
I used to use powershell delivered by github release, now as I favor the convenience of microsoft-store's integrated update, I switch to powershell in microsoft store.
But then bugs appear:
$PSHOME\pwsh.exe which is
"C:\Program Files\WindowsApps\Microsoft.PowerShellPreview_7.2.2.0_x64__8wekyb3d8bbwe\pwsh.exe"
vscode-powershell cannot recognize microsoft store installed powershell as well
The text was updated successfully, but these errors were encountered: