Finetuning screen brightness with PowerShell

When I work in a low-light environment I like to have fine-grained control over the brightness of my monitor. When I change the brightness using the special function keys on my keyboard, it changes in steps of 10%! That's a lot. PowerShell to the rescue!

The following PowerShell script will give you better control; it will allow you to specify the brightness as a (whole) percentage:

$brightness = 2
$delay = 5
$display = Get-WmiObject -Namespace root\wmi -Class WmiMonitorBrightnessMethods
$display.WmiSetBrightness($delay, $brightness)

Converted into a one-liner it would look like this:

$b=2;(gwmi -n root\wmi -cl WmiMonitorBrightnessMethods).WmiSetBrightness(5, $b)

You could execute it from Run: (ctrl+r), just prefix the script with powershell:

powershell $b=2;(gwmi -n root\wmi -cl WmiMonitorBrightnessMethods).WmiSetBrightness(0, $b)

Or run the script on a hot key.

No more sunglasses needed!
  1. KERR says:

    This is brilliant, cheers! Heaps better than the MS scripting guy’s article 💪

expand_less