PowerShell for Windows Admins

Jun 23 2011   3:16PM GMT

root\wmi – Monitor brightness

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

Tags:

The monitor brightness can be discovered like this

function get-monitorBrightness {

$monitors = Get-WmiObject -Namespace root\wmi -Class WmiMonitorBrightness

foreach ($monitor in $monitors){
$brightness = New-Object -TypeName PSObject -Property @{
CurrentLevel = $monitor.CurrentBrightness
MaxLevel = $($monitor.Level | sort | select -Last 1)
}
$brightness
}
}

The WmiMonitorBrightness class is used. The level property holds the brightness levels that can be set. A simple sort ensures we get the maximum setting

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: