# Finetuning screen brightness with PowerShell

**Date:** 2018-12-19  
**Author:** Kees C. Bakker  
**Categories:** PowerShell, Windows  
**Original:** https://keestalkstech.com/finetuning-screen-brightness-with-powershell/

![Finetuning screen brightness with PowerShell](https://keestalkstech.com/wp-content/uploads/2018/12/photo-1534972195531-d756b9bfa9f2.jpg)

---

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:

```powershell
$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:

```powershell
$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
powershell $b=2;(gwmi -n root\wmi -cl WmiMonitorBrightnessMethods).WmiSetBrightness(0, $b)
```

Or [run the script on a hot key](https://stackoverflow.com/questions/39677467/launch-powershell-script-with-keyboard-hotkey).

![](https://keestalkstech.com/wp-content/uploads/2018/12/Thug-Life-Cool-Glasses-PNG1.png)
*No more sunglasses needed!*
