Skip to content

SDK: Proxy functions generated with [System.Management.Automation.ProxyCommand]::Create() incorrectly modify the -OutBuffer common parameter on invocation, mistakenly use ThrowΒ #10863

@mklement0

Description

@mklement0

When you create a proxy command, the begin block contains the following snippet:

       $outBuffer = $null
        if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer))
        {
            $PSBoundParameters['OutBuffer'] = 1
        }

That is, if a -OutBuffer value is passed, it is quietly reset to 1, which raises two questions:

  • Why does the -OutBuffer value need to be reset at all for the steppable pipeline created by the proxy (wrapper) command?

  • Assuming the intent is to reset the value so as to perform NO buffering, why is the value set to 1, which implies paired output (it is -OutBuffer 0 that specifies no buffering)?

Environment data

PowerShell Core 7.0.0-preview.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    HacktoberfestPotential candidate to participate in HacktoberfestIssue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-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