public override object GetPropertyValue()

in src/VSSetup.PowerShell/PowerShell/InstanceAdapter.cs [68:92]


        public override object GetPropertyValue(PSAdaptedProperty adaptedProperty)
        {
            if (adaptedProperty.BaseObject is Instance instance)
            {
                var name = adaptedProperty.Name;
                if (string.Equals(name, PSPathPropertyName, StringComparison.OrdinalIgnoreCase))
                {
                    return GetPSPath(instance);
                }

                object value = null;

                var property = adaptedProperty.Tag as InstanceProperty;
                if (property?.Property != null)
                {
                    return property.Property.GetValue(instance, null);
                }
                else if (instance.AdditionalProperties.TryGetValue(name, out value))
                {
                    return value;
                }
            }

            return null;
        }