Powershell script to change screen Orientation

Question:

I wrote a script to change primary screen orientation to portrait. my screen is 1920X1200
It runs and no error reported. But the screen does not rotated as i expected.

The code was modified from Set-ScreenResolution (Andy Schneider).
Does anybody can help me take a look?

Some reference site:

  1. Set-ScreenResolution :
    http://gallery.technet.microsoft.com/ScriptCenter/2a631d72-206d-4036-a3f2-2e150f297515/
  2. C code for change oridentation (MSDN) Changing Screen Orientation Programmatically :
    http://msdn.microsoft.com/en-us/library/ms812499.aspx

My Code:

Answer:

Source:

Powershell script to change screen Orientation by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply