I don't have keys on my keyboard to adjust the brightness of my screen. So i made a simple script to increase or decrease the brightness by 10%:
Brightness up: $Brigthness = Get-Ciminstance -Namespace root/WMI -ClassName WmiMonitorBrightness | select -ExpandProperty CurrentBrightness $Brigthness = $Brigthness + 10 (Get-WmiObject -Namespace root/WMI -Class WmiMonitorBrightnessMethods).WmiSetBrightness(1,$Brigthness)
For reducing the brightness i replace the + by a -.
I saved these scripts as ps1 files and made a shortcut on my desktop to open these in powershell via a keyboard command: Ctrl Shift + for increasing and Ctrl Shift - for decreasing the brightness.
Now here's the problem: when i press the command on my keyboard it takes a while for powershell to start up and run the script. It takes about 5 seconds for my screen to actually change brightness.
Is there any way to adjust the script or something to let it run faster? Just like it would on a normal keyboard shortcut. Then it's almost instant.
I was thinking about already letting powershell run in the background so that it doensn't have to boot up first, but i have no idea how.
Thanks in advance! Really curious if there's a way.
What i did so far: $Brigthness = Get-Ciminstance -Namespace root/WMI -ClassName WmiMonitorBrightness | select -ExpandProperty CurrentBrightness $Brigthness = $Brigthness + 10 (Get-WmiObject -Namespace root/WMI -Class WmiMonitorBrightnessMethods).WmiSetBrightness(1,$Brigthness)
Saved this as ps1 in my documents file.
Made a shortcut on desktop linking to the file path and assigned Ctrl Shift + as a keyboard shortcut to run it in PowerShell.