private void InvokeOnProperty(PSObject value, bool raw, PropertyAction action) { DirectoryEntryPropertyDictionary entryProperties = GetProperties(raw); foreach (PSPropertyInfo psprop in value.Properties) { if (entryProperties.ContainsKey(psprop.Name)) { action(entryProperties[psprop.Name], psprop.Value); } } }
private DirectoryEntryPropertyDictionary GetProperties(bool raw) { DirectoryEntryPropertyDictionary properties = new DirectoryEntryPropertyDictionary(); if (raw) { properties.AddRange(DirectoryEntryType.GetRawProperties(Entry)); } else { foreach (DirectoryEntryType type in Types) { properties.AddRange(type.GetProperties(Entry)); } } return(properties); }
private DirectoryEntryPropertyDictionary GetProperties(bool raw) { DirectoryEntryPropertyDictionary properties = new DirectoryEntryPropertyDictionary(); if (raw) { properties.AddRange(DirectoryEntryType.GetRawProperties(Entry)); } else { foreach (DirectoryEntryType type in Types) { properties.AddRange(type.GetProperties(Entry)); } } return properties; }