Skip to content

Fix default formatting for deserialized MatchInfo - #11728

Merged
Ilya (iSazonov) merged 1 commit into
PowerShell:masterfrom
iSazonov:remoting-matchinfo
Mar 18, 2020
Merged

Ilya (iSazonov) merged 1 commit into
PowerShell:masterfrom
iSazonov:remoting-matchinfo

Conversation

@iSazonov

@iSazonov Ilya (iSazonov) commented Jan 30, 2020 •

Copy link
Copy Markdown
Collaborator

PR Summary

Fix #3480

MatchInfo class has ToEmphasizedString() member method to color output line.
In remote scenario MatchInfo class is deserialized as Deserialized.Microsoft.PowerShell.Commands.MatchInfo without the method. As result default formating in remote scenario show nothing.

The fix is to directly output Line property.

No tests are added because we haven't remote CI tests. Tested manually.

PR Context

PR Checklist

@iSazonov Ilya (iSazonov) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Jan 30, 2020
@iSazonov Ilya (iSazonov) added this to the 7.1.0-preview.1 milestone Jan 30, 2020
@iSazonov Ilya (iSazonov) self-assigned this Jan 30, 2020
@PaulHigin

Copy link
Copy Markdown
Contributor

Ilya (@iSazonov)
The cited issue doesn't seem to be related to this change. Please add repro steps that demonstrate the problem being fixed.

@iSazonov

Copy link
Copy Markdown
Collaborator Author

Paul Higinbotham (@PaulHigin) I updated a link to the issue.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vexx32

Copy link
Copy Markdown
Collaborator

🤔 makes me wonder if we're not better off moving the emphasis method out of the MatchInfo class itself and make it a helper method on a utils class somewhere instead.

@iSazonov

Copy link
Copy Markdown
Collaborator Author

Rain Sallow (/u/ta11ow) (@vexx32) The fix is simple and we could include it in 7.0.1.

Moving the emphasis method is more complex and we can break something. We need to think about this more.

@iSazonov
Ilya (iSazonov) merged commit 43e0e1a into PowerShell:master Mar 18, 2020
@iSazonov
Ilya (iSazonov) deleted the remoting-matchinfo branch March 18, 2020 13:43
@ghost

Copy link
Copy Markdown

🎉v7.1.0-preview.1 has been released which incorporates this pull request.:tada:

Handy links:

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
MatchInfo class has ToEmphasizedString() member method to color output line.
In remote scenario MatchInfo class is deserialized as Deserialized.Microsoft.PowerShell.Commands.MatchInfo without the method. As result default formating in remote scenario show nothing.

The fix is to directly output Line property.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deserialized.Microsoft.PowerShell.Commands.MatchInfo not formatted correctly

4 participants