Get Screen resolution using WMI/powershell in Windows 7

后端 未结 6 625
温柔的废话
温柔的废话 2020-11-30 02:15

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

6条回答
  •  死守一世寂寞
    2020-11-30 02:44

    You can grab this from the Win32_VideoController WMI class. The VideoModeDescription property includes the screen resolution and the color depth.

    (Get-WmiObject -Class Win32_VideoController).VideoModeDescription;
    

    Result

    1600 x 900 x 4294967296 colors
    

提交回复
热议问题