PowerShell for Windows Admins

Jun 23 2011   3:16PM GMT

root\wmi – Monitor brightness

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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: