// Check for restrictions on active power schemes.
            /// </summary>
            ACCESS_ACTIVE_SCHEME = 0x13,
            /// <summary>
            /// Check for restrictions on creating or restoring power schemes.
            /// </summary>
            ACCESS_CREATE_SCHEME = 0x14
        };

        public enum POWER_PLATFORM_ROLE
        {
            PlatformRoleUnspecified = 0,
            PlatformRoleDesktop = 1,
            PlatformRoleMobile = 2,
            PlatformRoleWorkstation = 3,
            PlatformRoleEnterpriseServer = 4,
            PlatformRoleSOHOServer = 5,
            PlatformRoleAppliancePC = 6,
            PlatformRolePerformanceServer = 7,
            PlatformRoleMaximum = 8
        };

        [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
        public struct SYSTEM_POWER_CAPABILITIES
        {

            /// BOOLEAN->BYTE->unsigned char
            public byte PowerButtonPresent;

# Copyright  2008, Microsoft Corporation. All rights reserved.

. .\CL_Utility.ps1

#
# Start the SysMain and set the mode as automatic
#
Import-LocalizedData -BindingVariable localizationString -FileName CL_LocalizationData

Write-DiagProgress -activity $localizationString.progress_rs_startSysMainService

[string]$startupType = (Get-WmiObject -query "select * from win32_baseService where Name='SysMain'").StartMode

if($startupType -ne "auto" -and $startupType -ne $null)
{
    (Get-WmiObject -query "select * from win32_baseService where Name='SysMain'").changeStartMode("automatic")
}

Start-Service SysMain
WaitFor-ServiceStatus "SysMain" ([ServiceProcess.ServiceControllerStatus]::Running)