How to get the current brightness of your monitor from command line on Windows

The ControlMyMonitor utility allows you to view and change the settings of your monitor from GUI and command-line.
In order to get the current brightness of your monitor from command-line, you can use the combination of 2 tools - ControlMyMonitor and GetNir. ControlMyMonitor sends to stdout the list of all monitor settings and the GetNir tool extracts the desired value you need.

Here's the command to send the current monitor brightness to stdout:
ControlMyMonitor.exe /stab "" | GetNir "Current Value" "VCPCode=10"

The '10' number (VCPCode=10) specifies the VCP Code of brightness. For every monitor setting there is a different VCP Code. The brightness is returned as a value between 0 and 100.

If you have multiple monitors, you also have to specify the name of monitor, for example:
ControlMyMonitor.exe /stab "" "\\.\DISPLAY2\Monitor0" | GetNir "Current Value" "VCPCode=10"

It's also possible to get the current monitor brightness as return code of the program ( %errorlevel% ) by using the /GetValue command-line option.
Here's an example for batch file that gets and prints the current monitor brightness:
ControlMyMonitor.exe /GetValue "Primary" 10
echo %errorlevel%

Be aware that ControlMyMonitor will work on your system only if your hardware supports DDC/CI, and you have Windows Vista or later version of Windows (Including Windows 10). Windows XP is not supported.