Ejemplo n.º 1
0
 protected override void BeginProcessing()
 {
     var osClass = new ManagementClass("Win32_OperatingSystem");
     osClass.Options.UseAmendedQualifiers = true;
     foreach (ManagementObject instance in osClass.GetInstances())
     {
         var dmtfLastBootUpTime = (string)instance.Properties["LastBootUpTime"].Value;
         var lastBootUpTimeInfo = new LastBootUpTimeInfo(dmtfLastBootUpTime);
         WriteObject(lastBootUpTimeInfo);
         break;
     }
 }
Ejemplo n.º 2
0
        protected override void BeginProcessing()
        {
            var osClass = new ManagementClass("Win32_OperatingSystem");

            osClass.Options.UseAmendedQualifiers = true;
            foreach (ManagementObject instance in osClass.GetInstances())
            {
                var dmtfLastBootUpTime = (string)instance.Properties["LastBootUpTime"].Value;
                var lastBootUpTimeInfo = new LastBootUpTimeInfo(dmtfLastBootUpTime);
                WriteObject(lastBootUpTimeInfo);
                break;
            }
        }