/// <summary>
        /// Process the command.
        /// </summary>
        protected override void ProcessRecord()
        {
            DMI dmi = DMI.CreateInstance();
            DmiStructureCollection structures = dmi.Structures;
            DmiStructure           structure  = structures[Class];
            DmiClass @class = structure.Elements[0];
            IEnumerable <IPropertyKey> properties = @class.ImplementedProperties;

            var result = new List <PropertyDefinitionResult>();

            foreach (var property in properties)
            {
                result.Add(
                    new PropertyDefinitionResult
                {
                    Class              = Class,
                    ClassId            = (int)Class,
                    HexadecimalClassId = $"{(int)Class:X2}",
                    ImplementedVersion = $"{(@class.ImplementedVersion == DmiStructureVersion.Latest ? "Latest" : @class.ImplementedVersion.ToString())}",
                    PropertyKey        = property
                });
            }

            WriteObject((PropertyDefinitionResult[])result.ToArray().Clone(), true);
        }
Beispiel #2
0
        /// <summary>
        /// Process the command.
        /// </summary>
        protected override void ProcessRecord()
        {
            DMI dmi = DMI.CreateInstance();
            DmiStructureCollection structures  = dmi.Structures;
            DmiStructure           structure   = structures[Property.Class];
            DmiClass            element        = structure.Elements[Property.Index];
            QueryPropertyResult propertyResult = element.GetProperty(Property.PropertyKey);

            WriteObject(propertyResult.Value);
        }
Beispiel #3
0
 /// <summary>
 /// Inicializa una nueva instancia de la estructura <see cref="DmiDeviceInfo"/>.
 /// </summary>
 /// <param name="structure">Estructura <see cref="iTin.Core.Hardware.Specification.SMBIOS"/>.</param>
 /// <param name="dmiClass">Clase.</param>
 /// <param name="index">Índice de la clase.</param>
 public DmiDeviceInfo(SmbiosStructure structure, DmiClass dmiClass, int index)
 {
     Index     = index;
     Class     = dmiClass;
     Structure = structure;
 }