Skip to content

power_profile_always_on.ps1

Corey Watson edited this page Dec 1, 2025 · 1 revision

power_profile_always_on.ps1

Set Always-On Power Profile.

Overview

Creates a custom "Always On - Limehawk" power plan optimized for workstations that should never sleep while on AC power. If the plan already exists, it will be reused and reconfigured. The plan is based on High Performance settings.

Purpose

This script creates and configures a custom power plan designed for systems that need to remain awake and accessible at all times (such as servers, monitoring stations, or remote access workstations). The plan prevents sleep and hibernation on AC power while maintaining reasonable battery-saving settings for portable devices.

Prerequisites

  • Windows 10/11 or Windows Server 2016+
  • Administrator privileges
  • High Performance power plan must exist

Configuration

Required Inputs

  • $customPlanName : Name of the custom power plan (default: "Always On - Limehawk")
  • $displayTimeoutAC : Display timeout on AC power (minutes, default: 30)
  • $displayTimeoutDC : Display timeout on battery (minutes, default: 10)
  • $diskTimeoutAC : Hard disk timeout on AC power (minutes, default: 60)
  • $diskTimeoutDC : Hard disk timeout on battery (minutes, default: 30)
  • $standbyTimeoutAC : Sleep timeout on AC power (0 = never, default: 0)
  • $standbyTimeoutDC : Sleep timeout on battery (minutes, default: 20)
  • $hibernateTimeoutAC : Hibernate timeout on AC power (0 = never, default: 0)
  • $hibernateTimeoutDC : Hibernate timeout on battery (minutes, default: 45)

Behavior

  1. Validates all hardcoded timeout values and plan name
  2. Verifies script is running with Administrator privileges
  3. Checks if custom power plan already exists
  4. Creates or reuses the custom power plan
  5. Sets the custom plan as active
  6. Configures all power timeouts
  7. Disables hibernation on desktops (no battery)

Security Notes

  • No secrets in logs
  • All operations are local

Exit Codes

  • 0 = Success
  • 1 = Failure

Example Output

[ INPUT VALIDATION ]
--------------------------------------------------------------
All required inputs are valid

[ POWER PLAN SETUP ]
--------------------------------------------------------------
Custom Plan Name         : Always On - Limehawk
Plan Status              : Creating new plan
Active Plan              : Always On - Limehawk

[ APPLYING POWER SETTINGS ]
--------------------------------------------------------------
Display Timeout (AC)     : 30 minutes
Standby Timeout (AC)     : 0 (Never)

[ FINAL STATUS ]
--------------------------------------------------------------
Power plan configured successfully

[ SCRIPT COMPLETED ]
--------------------------------------------------------------

Version History

  • v2.0.0 (2024-12-01) - Migrated from SuperOps - removed module dependency
  • v1.0.0 (2025-09-12) - Initial version

Links

Clone this wiki locally