public static FormatShape SelectByData(PSObject data) { if (data.BaseObject == null) // if it's null we don't really care... { return FormatShape.List; } var defaultDisplayProperties = data.GetDefaultDisplayPropertySet(); if (defaultDisplayProperties.Count <= MaxPropertiesInTable) { return FormatShape.Table; } return FormatShape.List; }
protected Collection<PSPropertyInfo> GetSelectedProperties(PSObject psobj) { if (Options.Properties == null || Options.Properties.Length < 1) { var defProps = psobj.GetDefaultDisplayPropertySet(); return defProps; } var props = new Collection<PSPropertyInfo>(); foreach (var cur in Options.Properties) { props.Add(EvaluateProperty(psobj, cur)); } return props; }
protected Collection<PSPropertyInfo> GetSelectedProperties(PSObject psobj) { if (Options.Properties == null || Options.Properties.Length < 1) { var defProps = psobj.GetDefaultDisplayPropertySet(); return defProps; } return psobj.SelectProperties(Options.Properties, ExecutionContext); }