| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| /// </summary> | ||
| internal static class OutOfBandFormatViewManager | ||
| { | ||
| private static bool IsNotRemotingProperty(string name) |
There was a problem hiding this comment.
It seems we should rename the method. Maybe IsNotPSSpecificProperty
Sorry, something went wrong.
| || 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.
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.
Sorry, something went wrong.
|
GregoireLD Do you want to continue? |
Sorry, something went wrong.
|
Ilya (@iSazonov) yes, sorry I got busy lately, but I still aim to fix it for good |
Sorry, something went wrong.
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
Sorry, something went wrong.
|
This pull request appears inactive. If there are plans to continue work, please update the PR within 14 days; otherwise it may be closed. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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 IsNotRemotingProperty function in two ways: adds the currently missing RemotingConstants.EventObject kind (currently missing from the evaluation), and also adds the PSObject.PSTypeNames kind to the exclusion list to ensure introspected propertyless objects don't get misjudged as "property-full".
Also, maybe changing the IsNotRemotingProperty into a new name like IsNotBlacklistedProperty or IsNotSkippedProperty 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