Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix Propertyless Object not displaying after ETS introspection - Simple Fix#26520

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

Open
GregoireLD wants to merge2 commits intoPowerShell:master
base:master
Choose a base branch
Loading
fromGregoireLD:ShortFix

Conversation

@GregoireLD
Copy link

@GregoireLDGregoireLD commentedNov 24, 2025
edited by iSazonov
Loading

PR Summary

Fix#25832
This fix the case where a Propertyless object is rendered undisplayable after being inspected using Get-Member or any similar introspection commands.

PR Context

Propertyless object are usually displayed using a fallback to their ToString() methods.
But the method currently used to evaluate the "Propertyless-ness" of an object relies on a flawed evaluation:
After inspecting the object, one new property gets dynamically attached to the object, rendering it undisplayable, because no longer regarded as Propertyless.

This PR fixes and extend the currentIsNotRemotingProperty function in two ways: adds the currently missingRemotingConstants.EventObject kind (currently missing from the evaluation), and also adds thePSObject.PSTypeNames kind to the exclusion list to ensure introspected propertyless objects don't get misjudged as "property-full".

Also, maybe changing theIsNotRemotingProperty into a new name likeIsNotBlacklistedProperty orIsNotSkippedProperty could be a good idea to mach this function extended purpose, but I wanted to get some feedback before any name change.

The full rational and discussion prior to making this PR can be found in my issue report :
#25832

PR Checklist

@iSazonoviSazonov added the CL-GeneralIndicates that a PR should be marked as a general cmdlet change in the Change Log labelNov 24, 2025
/// </summary>
internalstaticclassOutOfBandFormatViewManager
{
privatestaticboolIsNotRemotingProperty(stringname)
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems we should rename the method. MaybeIsNotPSSpecificProperty

||name.Equals(RemotingConstants.SourceJobInstanceId,StringComparison.OrdinalIgnoreCase);
||name.Equals(RemotingConstants.SourceJobInstanceId,StringComparison.OrdinalIgnoreCase)
||name.Equals(RemotingConstants.EventObject,StringComparison.OrdinalIgnoreCase)
||name.Equals(PSObject.PSTypeNames,StringComparison.OrdinalIgnoreCase);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd prefer to cover all code branches by tests.
I suggest using TestCases with ma,es of the properties and manually add the properties (one per test) to propertyless object.

@microsoft-github-policy-servicemicrosoft-github-policy-servicebot added the Review - NeededThe PR is being reviewed labelDec 1, 2025
@iSazonov
Copy link
Collaborator

@GregoireLD Do you want to continue?

@microsoft-github-policy-servicemicrosoft-github-policy-servicebot removed the Review - NeededThe PR is being reviewed labelDec 11, 2025
@GregoireLD
Copy link
Author

@iSazonov yes, sorry I got busy lately, but I still aim to fix it for good

iSazonov reacted with thumbs up emoji

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

Reviewers

@iSazonoviSazonoviSazonov left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

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

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Hidden-only class loses ToString() formatting after Get-Member inspection

2 participants

@GregoireLD@iSazonov

[8]ページ先頭

©2009-2025 Movatter.jp