You’ve got the Power!! plan….

Today I was playing around on some machines on which I noticed the Power Plans were set incorrect, Balanced on a server :'(

Now of course I can do this manually, or I can use PowerShell instead!

Tools not scripts

Since I want to use this more often and want to create my own “toolbelt” [aka module with common tools], I’ve decided to make the solution as advanced functions, not just scripts.

This means that if you simply copy/paste them, you will need to dot source them first in order to use them.
Dutch PowerShell MVP Jeff Wouters has a good article on this in case you want some more info on this.

Quick info:

to the directory in which you have the .ps1 files in case you have them saved seperately and dot source them using

The following functions are provided:

  • Get-AllPowerPlan
  • Get-ActivePowerPlan
  • Set-ActivePowerPlan

I’m guessing the names sort speak for themselves, but do take into account that the Set-ActivePowerPlan relies on the other functions to… well… function 🙂

The Code

 

Happy Scripting! 🙂

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Robert

It never hurts to Get-Help

2 thoughts to “You’ve got the Power!! plan….”

    1. Hey Gyz,

      Sorry for the late reply, had a nice weekend away from the computer 🙂
      If you run Get-ActivePowerplan, does it show your changes?
      Also, on which OS are you running this?

      Last but not least, in case you still have issues, try running the function with -Verbose to see what’s happening [same with the Get-ActivePowerplan one].
      Hit me up if you still have issues.

Leave a Reply

Your email address will not be published. Required fields are marked *