private void EnsureProperties()

in src/VSSetup.PowerShell/PowerShell/InstanceAdapter.cs [112:132]


        private void EnsureProperties(Instance instance)
        {
            Func<PropertySet> initializer = () =>
            {
                var properties = new PropertySet();
                foreach (var property in GetProperties(instance))
                {
                    properties.Add(property);
                }

                return properties;
            };

            lock (propertiesLock)
            {
                if (properties == null)
                {
                    properties = initializer();
                }
            }
        }