Sunday, June 9, 2024

Changing Display Resolution on VM using PowerShell

 I had this issue with my automation script which needed 1920X1080 resolution on my VM to run my automation scripts. I searched a lot and came across this solution which worked for me and could be helpful to others.

1. The display settings module need to be installed. To install run the below command in PowerShell in admin mode

 Install-Module -Name DisplaySettings 

2. You can run any of the below commands to set the resolution

powershell -Command "Set-DisplayResolution -Width 1920 -Height 1080"

                      or

Set-DisplayResolution -Width 1920 -Height 1080


Note:- Display settings cannot be set for a remote machine by logging in hence i had to use commands to set it.

 

No comments:

Post a Comment