Skip to content

Misleading error message when piping native command to throwing powershell #2803

Closed

Description

@vors

Steps to reproduce

git | % {throw 1}  

git can be replaced to any native executable with non-empty standart output.

Expected behavior

Error with FullyQualifiedErrorId : 1, just like in throw 1 case.

Actual behavior

Error with FullyQualifiedErrorId : NativeCommandFailed

PS /> git | % {throw 1}                                                                                                                
Program 'git' failed to run: 1At line:1 char:1
+ git | % {throw 1}
+ ~~~.
At line:1 char:1
+ git | % {throw 1}
+ ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
    + FullyQualifiedErrorId : NativeCommandFailed

Environment data

> $PSVersionTable
Name                           Value                                                                                                  
----                           -----                                                                                                  
PSVersion                      6.0.0-alpha                                                                                            
PSEdition                      Core                                                                                                   
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                
BuildVersion                   3.0.0.0                                                                                                
GitCommitId                    v6.0.0-alpha.13                                                                                        
CLRVersion                                                                                                                            
WSManStackVersion              3.0                                                                                                    
PSRemotingProtocolVersion      2.3                                                                                                    
SerializationVersion           1.1.0.1 
Name                           Value                                                                                                  
----                           -----                                                                                                  
PSVersion                      6.0.0-alpha                                                                                            
PSEdition                      Core                                                                                                   
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                
BuildVersion                   3.0.0.0                                                                                                
GitCommitId                    v6.0.0-alpha.11                                                                                        
CLRVersion                                                                                                                            
WSManStackVersion              3.0                                                                                                    
PSRemotingProtocolVersion      2.3                                                                                                    
SerializationVersion           1.1.0.1     

Note: it repros on both alpha.11 and alpha.13 so it's not a regression introduced in #2450

Activity

  1. iSazonov commented on Nov 30, 2016

    @iSazonov
    Collaborator

    The same on Windows 10:

    Name                           Value
    ----                           -----
    PSVersion                      5.0.10240.17146
    WSManStackVersion              3.0
    SerializationVersion           1.1.0.1
    CLRVersion                     4.0.30319.42000
    BuildVersion                   10.0.10011.16384
    PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
    PSRemotingProtocolVersion      2.3
    
  2. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  3. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  4. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  5. microsoft-github-policy-service commented on Nov 23, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-No ActivityIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtime

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions