- Notifications
You must be signed in to change notification settings - Fork7.7k
Fix a bug in how Write-Host handles XML Elements#24669
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
brendandburns commentedDec 12, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Added a unit test. |
Another option would be to return |
src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteConsoleCmdlet.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
…teConsoleCmdlet.csCo-authored-by: Dongbo Wang <dongbow@microsoft.com>
…t.Tests.ps1Co-authored-by: Steve Lee <slee@microsoft.com>
90b0149
intoPowerShell:masterUh oh!
There was an error while loading.Please reload this page.
PR Summary
Changes how the
Write-Host
cmdlet handles XMLElements,fixes#24508PR Context
I'm not positive this is the right fix, spiritually I could get behind using
.OuterXml
instead which would print the whole XML document from that element, which seems aligned with the iteration of an Enumerable.Either way, it is definitely the case that the current code doesn't work as expected.
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.- [X] Issue filed:
Write-Host
renders an[xml]
or[XmlElement]
instance as an empty line. #24508(which runs in a different PS Host).