Adjust screen resolution on Windows executor

There are situations where you may want to increase (or decrease) the screen resolution within the Windows VM for testing purposes.

This can be done directly in the job with a run step, like the following:

- run:
    name: Restart local mstsc
    command: psexec64.exe -accepteula -nobanner -i 0 mstsc /v:localhost /w:3840 /h:2160 # 4K!
    background: true
- run:
    name: Naive impl to wait until the screen stretches
    command: Start-Sleep 5

The above would set the resolution to 3840x2160 -- you can verify this is the case with the following run command:

- run:
    name: Get screen info
    command: |
      Add-Type -AssemblyName System.Windows.Forms
      [System.Windows.Forms.Screen]::AllScreens | fl *
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.