Change display settings using the service

We use TeamCity to start our tests. TeamCity Agent runs as a service on the main virtual machine running Windows Server 2012, a headless machine (managed by Hyper-V).

Right now it Get-DisplayResolutionreturns 1024X728. And when you try to change the display resolution with Set-DisplayResolution, it returns: T h e s e t t i n g s p a s s e d i n c o u l d n o t b e a p p l i e d t o t h e g r a p h i c s d e v i c e .

This machine seems to use the Microsoft Basic Display Adapater driver (because there is no real display), and this driver corrects the resolution to 1024x768 (virtual resolution). But to complete our tests, we would like to have a resolution of 1920x1080. We do not run our user interface tests directly on this machine, but TestComplete will create another RDP connection on the slave machines to run the user interface tests. These RDP connections will use the permission of the wizard. That's why we want to get the best resolution on our host, where the TeamCity agent is located.

Is there a way to change this permission, possibly using Hyper-V, or can I change the display settings through TeamCity using a powershell script or another way?

Thank you for your responses,

Camille

+4
source share

Source: https://habr.com/ru/post/1670685/


All Articles