Wednesday, January 2, 2013

Setting Display Resolution using Powershell V3


First of all I want to congratulate all new MVPs and want to thanks them their contribution to the community . I also want to congratulate “Sarabpreet Singh Anand” who became a “SQL” MVP this year for first time, brother we do proud on you.

Today “New Delhi” is feeling like a big refrigerator the temperature is almost 8 Degree Celcius and a heavy fog is every where.

02-01-2013 13-27-24


I am in love with Powershell V3, I think in this new version we have CMDLET for each and every task. Today i am going to show you a very simple task , the task in setting Display Resolution on Desktop using Powershell V3 Cmdlets.

Open PowerShell Console { You know hot to do this ;o) }

02-01-2013 13-06-19

To know you current display resolution use this cmdlet “Get-DisplayResolution”.

02-01-2013 13-07-04

So my current display resolution is “1920x1080” . Now lets change the resolution using the another cmdlet “Set-DisplayResolution

type and run “Set-DisplayResolution

it ask you to define the width of resolution in pixels : i typed 800

02-01-2013 13-07-50

after define the width in Pixels we have to provide the height pixel size of 600

02-01-2013 13-08-07

02-01-2013 13-10-01

Hit enter .

Now a new windows opens and asking for the confirmation that if we want to apply the display setting or not, if you enter “Y” new display resolution will be applied, if you enter “N” then you are back to the original display resolution nothing will be changes and if you type or enter nothing you will be back to original display settings.

In my case i type and enter “Y”

02-01-2013 13-08-32

and my display resolution is changed.

02-01-2013 13-09-36

Smile cool…..

but wait… we can make the above in to  one-liner so that we can  use this on our scripts so that it won’t ask for any confirmation window.

Set-DisplayResolution -Width 800 -Height 600 -Force

02-01-2013 13-38-52



Aman Dhally


clip_image001 clip_image002 clip_image003 clip_image005 clip_image007

1 comment: