community.windows.win_power_plan (2.2.0) — module

Changes the power plan of a Windows system

Authors: Noah Sparks (@nwsparks)

Install collection

Install with ansible-galaxy collection install community.windows:==2.2.0


Add to requirements.yml

  collections:
    - name: community.windows
      version: 2.2.0

Description

This module will change the power plan of a Windows system to the defined string.

Windows defaults to C(balanced) which will cause CPU throttling. In some cases it can be preferable to change the mode to C(high performance) to increase CPU performance.

One of I(name) or I(guid) must be provided.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Change power plan to high performance
  community.windows.win_power_plan:
    name: high performance
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Change power plan to high performance
  community.windows.win_power_plan:
    guid: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c

Inputs

    
guid:
    description:
    - String value that indicates the desired power plan by guid.
    - The power plan must already be present on the system.
    - For out of box guids see U(https://docs.microsoft.com/en-us/windows/win32/power/power-policy-settings).
    required: false
    type: str
    version_added: 1.9.0
    version_added_collection: community.windows

name:
    description:
    - String value that indicates the desired power plan by name.
    - The power plan must already be present on the system.
    - Commonly there will be options for C(balanced) and C(high performance).
    required: false
    type: str

Outputs

all_available_plans:
  description: The name and enabled state of all power plans.
  returned: always
  sample: "{\n    \"High performance\":  false,\n    \"Balanced\":  true,\n    \"\
    Power saver\":  false\n}\n"
  type: dict
power_plan_enabled:
  description: State of the intended power plan.
  returned: success
  sample: true
  type: bool
power_plan_name:
  description: Value of the intended power plan.
  returned: always
  sample: balanced
  type: str