Skip to content

I get the error "/bin/sh: 1: powershell: not found" in visual Studio Code running on Ubuntu 18.04 #3166

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
arendkolk opened this issue Feb 5, 2021 · 2 comments
Labels
Resolution-Fixed Will close automatically.

Comments

@arendkolk
Copy link

Hi,

I get the error "/bin/sh: 1: powershell: not found" in the OUTPUT tab in Visual Studio Code Version 1.53.0 when i try to run simple script in a new file which is open in the editor.

does the "which pwsh" output "/opt/microsoft/powershell/7/pwsh" have anything to do with this? Maybe the path.

image

And the PROBLEMS tab outputs:
image

Secondly sometimes auto completion works inside the editor and sometimes it doesn't. For example typing " Write-Host" in the editor does not auto complete. I know "sometimes" is a strange concept in IT but its true in this case.

image

some extra details:
PS /home/arend/.vscode/extensions/ms-vscode.powershell-2020.6.0/examples> which pwsh
/opt/microsoft/powershell/7/pwsh

PS /home/arend/.vscode/extensions/ms-vscode.powershell-2020.6.0/examples> $PSVersionTable
Name Value
PSVersion 7.1.1
PSEdition Core
GitCommitId 7.1.1
OS Linux 5.4.0-65-generic #73~18.04.1-Ubuntu SMP Tue Jan 19 09:02:24 UTC 2021
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Visual Studio Code
Version: 1.53.0
Commit: 8490d3dde47c57ba65ec40dd192d014fd2113496
Date: 2021-02-03T15:56:04.185Z
Electron: 11.2.1
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Linux x64 5.4.0-65-generic

@ghost ghost added the Needs: Triage Maintainer attention needed! label Feb 5, 2021
@SydneyhSmith
Copy link
Collaborator

Thanks @arendkolk

when i try to run simple script in a new file which is open in the editor.

How are you running the file? Generally the PowerShell extension doesnt print in the output window and it looks like even though the extension has picked up pwsh, something else if making an assumption about powershell rather than pwsh being the thing to execute.

Secondly sometimes auto completion works inside the editor and sometimes it doesn't. For example typing " Write-Host" in the editor does not auto complete. I know "sometimes" is a strange concept in IT but its true in this case.

Do you see this issue "sometimes" as in sometimes with the same commands/files but say on different days, or sometimes as in some file/with some commands but not others?

It would also be great to know if you have any settings related to the PowerShell path/version in VSCode?

Thanks!

@SydneyhSmith SydneyhSmith added Needs-Repro-Info and removed Needs: Triage Maintainer attention needed! labels Feb 9, 2021
@arendkolk
Copy link
Author

Hi Sydney, Thank you for your reply. I have uninstalled and reinstalled Visual Studio Code (now via snap) and now the hanging is gone.

Visual Studio Code seemed to be hanging in the background (the little wheel in the left bottom kept spinning) but now finally i get the proper action popping up:

" WARNING: To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code to authenticate. "

cheers,

Arend

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Feb 15, 2021
@SydneyhSmith SydneyhSmith added Resolution-Fixed Will close automatically. and removed Needs: Maintainer Attention Maintainer attention needed! labels Feb 16, 2021
@ghost ghost closed this as completed Feb 16, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Fixed Will close automatically.
Projects
None yet
Development

No branches or pull requests

2 participants