≡ Menu

Powershell: Change monitor brightness

Recently I came across a method using which you can control the monitor brightness. This method uses the WMI class named “WMIMonitorBrightnessMethods” which lies under rootwmi. This WMI classes offers various other functions using which you can manage various parameters of monitor brightness

Here is the example code:

function Set-MonitorBrighness {
[CmdletBinding()]
param (
[ValidateRange(0,100)]
[int]$brightness
)            

$mymonitor = Get-WmiObject -Namespace rootwmi -Class WmiMonitorBrightnessMethods
$mymonitor.wmisetbrightness(5,$brightness)
}
Set-MonitorBrighness -brightness 1

 

This sets the monitor brightness level to 1%. The first parameter of the “wmisetbrightness” function is timeout which defines the time it takes to switch to the brightness one you have set.

Comments on this entry are closed.

  • MD. Mohiuddin Ahmed May 11, 2013, 2:18 am

    Will it work for PowerShell 1.0?