8000 pwsh script stuck at the end of running a native Linux command or binary if the script is called from a program instead of interactively · Issue #17082 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content
pwsh script stuck at the end of running a native Linux command or binary if the script is called from a program instead of interactively #17082
@yfengBTI

Description

@yfengBTI

Prerequisites

Steps to reproduce

This is a weird one.
I have a pwsh script that calls psql which in turn runs a .sql script which runs fine if I invoke the script from shell, but it would stuck if run from a program with pwsh -file script.ps1.
(The program is running as root)

I found that the issue is only with Linux binaries or native shell commands.
For example, a simple script like this would be stuck.

ls

or

ls > /tmp/test.out
Set-Content /tmp/continue "good"

However, as long as I only use pwsh commands, the script would finish.

Also, the linux binaries like psql and ls does actually run to finish but stuck at passing back control to the pwsh script.
In the above test script, /tmp/test.out does actually get written but the Set-Content never gets run.

Expected behavior

The script continues running

Actual behavior

Stuck at binaries or native commands

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.2.2
PSEdition                      Core
GitCommitId                    7.2.2
OS                             Linux 4.14.268-205.500.amzn2.x86_64 #1 SMP Wed Mar 2 18:38:38 UTC 2022
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs-ReproThe issue author needs to provide repro steps.Needs-TriageThe issue is new and needs to be triaged by a work group.Resolution-No ActivityIssue has had no activity for 6 months or more

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0