Skip to content

Honor -OutputFormat if specified in noninteractive, redirected, encoded command used with pwsh - #8115

Merged
Travis Plunk (TravisEz13) merged 1 commit into
PowerShell:masterfrom
SteveL-MSFT:console-outputformat
Oct 30, 2018
Merged

Travis Plunk (TravisEz13) merged 1 commit into
PowerShell:masterfrom
SteveL-MSFT:console-outputformat

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Oct 24, 2018 •

Copy link
Copy Markdown
Member

PR Summary

There is specific code that sets the OutputFormat to xml if pwsh is run non-interactive, with redirected output, and the command was encoded. However, it ignored whether OutputFormat was specified. Fix is to track whether -OutputFormat was used and respect that value rather than defaulting to xml.

Fix #5912

PR Checklist

honor outputformat if specified in noninteractive, redirected, encoded command case
@SteveL-MSFT

Copy link
Copy Markdown
Member Author

@PowerShell/powershell-committee agrees we should honor the user supplied -OutputFormat and accept this breaking change

@SteveL-MSFT Steve Lee (SteveL-MSFT) added Committee-Reviewed PS-Committee has reviewed this and made a decision and removed Review - Committee The PR/Issue needs a review from the PowerShell Committee labels Oct 24, 2018
@TravisEz13
Travis Plunk (TravisEz13) merged commit 1aa5bb3 into PowerShell:master Oct 30, 2018
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the console-outputformat branch March 10, 2020 21:01
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
…oded command used with pwsh (PowerShell#8115)

[Breaking Change]

There is specific code that sets the `OutputFormat` to xml if pwsh is run non-interactive, with redirected output, and the command was encoded.  However, it ignored whether OutputFormat was specified.  Fix is to track whether `-OutputFormat` was used and respect that value rather than defaulting to xml.

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

Labels

Breaking-Change breaking change that may affect users Committee-Reviewed PS-Committee has reviewed this and made a decision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pwsh ignores -OutputFormat text when writing to a redirected stderr stream

2 participants