Display Orientation & Rotation lock Settings - Win11

It would be helpful to be able to adjust settings when imaging a system to enable/disable “Rotation lock”. It appears that the default behavior in Windows 11 is to have Rotation Lock disabled. This results in the screen rotating, which we would like to lock down.

It would also be helpful to specify/force the Display orientation to Landscape. We have recently imaged a system and it was stuck on “Landscape (flipped)”.

We do not want the screen to rotate at all, so at this point we are manually (not ideal) adjusting the settings to lock rotation at landscape.

It would be nice to automate these settings within Immy when imaging new systems. I hope you would be able to assist with this! Thank you.

This should take care of the auto rotation, I couldn’t find a really easy way to set the screen orientation. it looks like there are registry keys for every screen the device has ever connected to at: HKLM\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration
that looked too dirty to try and sift through.
there was also a WIN32 API way to change it, but I am fairly ignorant to that.

Hope this helps!

#Parameters
param(
    [Parameter(Position = 0, mandatory = $true,HelpMessage = "True allows the screen to auto rotate. False disables the feature.")]
    [Boolean]$EnableAutoRotate = $false
)
$ARSetting = switch($EnableAutoRotate)
{
	"true" {1}
	"false" {0}
}
#Variables
$RegKeyPath = HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AutoRotation

Write-Verbose "Enable Auto Rotate should be  $EnableAutoRotate"
Get-windowsregistryvalue -Path $RegKeyPath -Name Enable | RegistryShould-Be -Value $ARSetting