PowerShell Power for Presenters
As a presenter I frequently need to make sure that my laptop is not in low power battery saving mode. I also don’t want the screensaver to start up when I walk away from the computer and point at the screen.
A while back, I showed you how to Control Power with PowerShell, but this time we’re going to go one step further – we’re going to build a presentation mode.
My only goal for this was to have a quick way to put a laptop into high performance mode and then switch back to a balanced power plan when I’m done with a presentation.
Initially I used the
Set-PowerHighPerformance function that I shared with you previously. Unfortunately, when I was away flailing around in front of the screen for a while, the screen suddenly when blank when I my screensaver turn on. Eager to solve the problem, I reserached how to disable both monitor sleep and the screensaver. We can accomplish this using some
powercfg options (specifically
-monitor-timeout-ac) and changing a registry value.
To make this happen, there are four functions
Set-PresentationModeOn. The only two I use are
PowerPlan – A PowerShell Module for Presenters
After rolling several individual functions, I put together a PowerShell module that I’m calling PowerPlan. PowerPlan wraps up all of the code from Control Power with PowerShell as well as the new functions I’ve described above.
Installing and Using the PowerPlan Module
- Change to your PowerShell modules directory. By default this is
- Get a copy of the PowerPlan module.
- Add this to your PowerShell profile:
There’s one gotcha – if your screensaver settings are pushed down to your computer through group policy the registry changes on line 44 will fail. The first GitHub Issue is for me to detect the right registry entry and not fail but, right now, it’s gonna fail.
If you want to share feedback – create a new GitHub issue. We’ll chat. It’ll be fun.
This is Jeremiah
I live in Portland, OR. I have two dogs.
I recently received a Master's of Science in Computer Science from Portland State University.
I'm was Microsoft MVP from 2009 - 2018 with a pile of certifications. Somewhere along the way, I wrote a database client for Riak and then handed it off to the community.