- Notifications
You must be signed in to change notification settings - Fork8.1k
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
base:master
Are you sure you want to change the base?
Conversation
| /// </summary> | ||
| internalstaticclassOutOfBandFormatViewManager | ||
| { | ||
| privatestaticboolIsNotRemotingProperty(stringname) |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
iSazonov commentedDec 11, 2025
@GregoireLD Do you want to continue? |
GregoireLD commentedDec 11, 2025
@iSazonov yes, sorry I got busy lately, but I still aim to fix it for good |
Uh oh!
There was an error while loading.Please reload this page.
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 current
IsNotRemotingPropertyfunction in two ways: adds the currently missingRemotingConstants.EventObjectkind (currently missing from the evaluation), and also adds thePSObject.PSTypeNameskind to the exclusion list to ensure introspected propertyless objects don't get misjudged as "property-full".Also, maybe changing the
IsNotRemotingPropertyinto a new name likeIsNotBlacklistedPropertyorIsNotSkippedPropertycould 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
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header