-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
pwsh does not execute script passed with -file on ubuntu #21411
Comments
Could not reproduce on Arch Linux, pwsh-7.5.0-preview.1, bash-5.2.26 |
Was not able to reproduce on 7.3.4 (yes I need to upgrade my PS version on Ubuntu machine 😆 ) I will upgrade soon and test on 7.4.1, if @237dmitry can't reproduce on preview then perhaps may have been fixed. |
Jammy with 7.4.1
How did you install PowerShell?
What do the symbolic links for ssl look like?
|
Get-ChildItem -File should do something like Get-ChildItem on Ubuntu snap PowerShell 7.4.1 when symlinks and dirs present, not only common files(or even device files...). Maybe fixed on 7.5 or something Ubuntu snap. |
I had the same issue on Ubuntu 22.04 with PowerShell 7.4.1 today and was fixed by updating to PowerShell version 7.4.2. It started only in the last few hours, and was working earlier today. Running a script from within
But again, I seem to be good now after updating. |
Issue came back yesterday for me. Still on PowerShell 7.4.2 and Ubuntu 22.04.4 LTS. Rebooting did not fix it. It crashes even with something as simple as ziviz@ziviz-ubuntu:~$ pwsh -command "write-host 'test'"
test
ziviz@ziviz-ubuntu:~$ sudo pwsh -command "write-host 'test'"
Stack overflow.
Aborted Running commands interactively works fine however ziviz@ziviz-ubuntu:~$ sudo pwsh
PowerShell 7.4.2
PS /home/ziviz> write-host "test"
test
PS /home/ziviz> exit |
I found a workaround for myself, but I have no clue what to make of it. If powershell starts crashing with Stack overflow, I can run pwsh with ziviz@ziviz-ubuntu:~$ sudo /usr/bin/pwsh -command "write-host 'test'"
Stack overflow.
Aborted
ziviz@ziviz-ubuntu:~$ sudo /usr/bin/pwsh -nol -command "write-host 'test'"
Stack overflow.
Aborted
ziviz@ziviz-ubuntu:~$ sudo /usr/bin/pwsh -nol -command "write-host 'test'"
Stack overflow.
Aborted
ziviz@ziviz-ubuntu:~$ sudo /usr/bin/pwsh -nol -noni -command "write-host 'test'"
Stack overflow.
Aborted
ziviz@ziviz-ubuntu:~$ sudo /usr/bin/pwsh -nol -noni -command "write-host 'test'"
Stack overflow.
Aborted
ziviz@ziviz-ubuntu:~$ sudo /usr/bin/pwsh -nol -noni -nop -command "write-host 'test'"
Stack overflow.
Aborted
ziviz@ziviz-ubuntu:~$ sudo /usr/bin/pwsh -nol -noni -nop -command "write-host 'test'"
Stack overflow.
Aborted
ziviz@ziviz-ubuntu:~$ sudo /usr/bin/pwsh -nol -noni -nop -w hidden -command "write-host 'test'"
Parameter -WindowStyle is not implemented on this platform.
ziviz@ziviz-ubuntu:~$ sudo /usr/bin/pwsh -command "write-host 'test'"
test |
I tested this workaround here, but unfortunately it didn't work. Thanks for your reply, anyway. I'm having this problem inside a vscode devcontainer, and restarting it doesn't solve the problem. I have to rebuild it every time this happens. I've tried 7.4.[0-2] versions but the problem persists. I'll keep trying with other versions and report here if I get any good results. |
Prerequisites
Steps to reproduce
system: pwsh 7.4.1 ubuntu 22.04 kernel 5.15.0-101-generic
all updated
in bash run pwsh -> works fine
in this pwsh session start a script (hello.ps1) -> works fine
start the script with pwsh -file hello.ps1 -> does not work
not from bash or in a pwsh session
also visualstudio code can not start a remote session to debug powershell
downgraded to 7.3.11 -> everything works fine
Expected behavior
Actual behavior
Error details
No response
Environment data
Visuals
No response
The text was updated successfully, but these errors were encountered: