Categories

root\wmi–set monitor brightness

Oddly the methods for changing the brightness aren’t on the WmiMonitorBrightness we get a separate class with the methods. This function can be used to set the brightness

function set-monitorBrightness {
[CmdletBinding()]
param (
[ValidateRange(5,20)]
[int]$timeout=5,
 
[ValidateRange(0,100)]
[int]$brightness
)
$monitors = Get-WmiObject -Namespace root\wmi -Class WmiMonitorBrightnessMethods

foreach ($monitor in $monitors){
  $monitor.WmiSetBrightness($timeout, $brightness)  
}    
}

 

Timeout is in seconds and is the time the change takes.  Set to 20 and watch a slow change

Brightness is the % brightness setting. The system will set the brightness to the nearest level available (see previous post)

One Response to root\wmi–set monitor brightness

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>