Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autopilot/Set-WindowsTimeZone.ps1 is in a non-functional state #47

Open
ghost opened this issue Mar 23, 2022 · 0 comments
Open

Autopilot/Set-WindowsTimeZone.ps1 is in a non-functional state #47

ghost opened this issue Mar 23, 2022 · 0 comments

Comments

@ghost
Copy link

ghost commented Mar 23, 2022

I have tried to run the Set-WindowsTimeZone script on several builds of Windows 10 and 11. The only change I made to the script is the key for AzureMaps.

Showcase:

Animation

The fix

During the Enable-LocationServices function, the following code is used to let Windows apps access location:

$AppsAccessLocation = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy"
Set-RegistryValue -Path $AppsAccessLocation -Name "LetAppsAccessLocation" -Value 0 -Type "DWord"

If we take a look at the details of this policy setting, a DWord of 0 means the user is in control. We instead need to set it to 1.

image

With the value set to one, the script executes as expected:

Animation

However, by doing so, the location services are still force enabled after the script finished execution:

image

To get rid of this, I've edited the Disable-LocationServices function to include the LetAppsAccessLocation DWord and set it to 0:

$AppsAccessLocation = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy"
Set-RegistryValue -Path $AppsAccessLocation -Name "LetAppsAccessLocation" -Value 0 -Type "DWord"

image

After execution:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants