Use power shell to adjust the display resolution on Windows 11.
Use power shell to adjust the display resolution on Windows 11.
Display resolution is set to 1920 x 1080. I need to adjust it to 1366 x 768 or vice versa. The provided script uses Pinvoke and ChangeDisplaySettings to update the display settings. Example usage is shown with 1024x768 at 60 Hz. Recently, switching to 1366x768 succeeded, but reverting back causes issues. PowerShell attempts fail when changing to 1920x1080 again. Someone has experience with this problem and can help resolve it.