I am using the following script to get screen resolution in Windows using WMI. The script works fine when the computer is in landscape mode but returns incorrect values when
You can grab this from the Win32_VideoController WMI class. The VideoModeDescription property includes the screen resolution and the color depth.
Win32_VideoController
VideoModeDescription
(Get-WmiObject -Class Win32_VideoController).VideoModeDescription;
1600 x 900 x 4294967296 colors