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;(Get-WmiObject -Namespace root\wmi -Class WmiMonitorBrightnessMethods).WmiSetBrightness(5, $b)

You could run the script on a hot key. Or execute it with Run: (ctrl+r), type powershell and paste the one-liner.

No more sunglasses needed!