Provides basic control over your monitor via VCP codes.
Importing the module
Import-Module 'C:\Path\To\MonitorControl.psd1'Get Monitor Names
Get-MonitorNames
MonitorName
-----------
\\.\DISPLAY3
\\.\DISPLAY1
\\.\DISPLAY2Set brightness on a single monitor
Set-MonitorBrightness -MonitorName '\\.\DISPLAY1' -BrightnessPercent 50Set brightness on all monitors
Get-MonitorNames | Set-MonitorBrightness -BrightnessPercent 100Set all monitors OSD language to English
Get-MonitorNames | Set-MonitorOSDLanguage -Language EnglishTurn all monitors off (note: if you set a monitor to Standby/Suspend, it will likely just turn back on again)
Get-MonitorNames | Set-MonitorPowerMode -PowerMode OffChange input of monitor 2 (you can use this to temporarily 'turn off' a monitor if you change to an input that is disconnected)
Set-MonitorInput -MonitorName '\\.\DISPLAY2' -InputName 'HDMI-1'Send arbitrary VCP codes (see DDCI_documentation_mccsV3.pdf)
# Set Brightness to 100%
Set-VCP -MonitorName '\\.\DISPLAY1' -VCPCode 0x10 -VCPValue 100Detaches a monitor effectively turning it off
Remove-Display -DisplayName '\\.\DISPLAY1'Reattaches a monitor or allows you to set resolution/refresh-rate on a monitor already attached and in-use
Set-Display -DisplayName '\\.\DISPLAY1' -ResolutionWidth 1920 -ResolutionHeight 1080 -RefreshRate 60The STRUCT used for DEVMODE does not contain the UNION needed for setting position so if your displays aren't oriented in 1 - 2 - 3 order, adding them back might put them out-of-order. I'm trying to figure out how to get this to work properly as it requires unsafe code which throws a memory access violation when trying to set the position.