Why oh why should such a simple thing as setting (or getting) the resolution or scale of a monitor be such a pain in the ****? Now that you know the motivator of me doing this... This is the DisplayHelper. Current capabilities:
· Get the resolution of each connected monitor (Logical and actual).
· Set the resolution of each monitor (Limited to what the monitor is capable of)
· Get the available, current and recommended scale per monitor (and resolution).
· Set the scale of each monitor.
· Get all of the different DPI-types.
· Get the output technology of each monitor (HDMI/Internal/DisplayPort etc)
· All of the above even if the resolution or scale changes or if a new monitor is connected.
The powershell script that I’m about to post has a new trick up its sleeve, at least a new one for me.
It can detect a dynamicparam, as you type it, and use the value of it in order to tab complete the next dynamicparam.
Eg. “ChooseFruit.ps1 –Fruit Apple/Blueberry/Banana” would allow the next dynamicparam, –FruitColor, to tab complete Green, Yellow or Red if -Fruit -eq Apple . ChooseFruit.ps1 –Fruit Apple –FruitColor Green/Yellow/Red.
A blueberry would only give –FruitColor the option of “Blue” and a banana the option of “Yellow/Green(Not to be consumed)”. =P
So when using Set-Resolution -MonitorName \\.\DISPLAY1, “-Resolution” will only Tab complete the possible resolutions for “\\.\DISPLAY1”.
This comes as a .dll for now as the code is a bloody mess. I would be ashamed to share it even with my own folks.
Made a powershell wrapper containing the following commands:
Set-MonitorResolution
Get-MonitorResolution
Set-MonitorScale
Get-MonitorScale
Get-Monitors
And for you ConfigMgr ppl, tired of the poor resolution in WinPE? I know I am. This seems to be working in WinPE as well :)
Is it possible for you write up a how to guide to intergrate this into a SCCM task sequence?
How are you getting the monitor size and resolution in WinPE?