@@ -206,6 +206,21 @@ Function EnableBackgroundApps {
206206 }
207207}
208208
209+ # Disable sensor features, such as screen auto rotation
210+ Function DisableSensors {
211+ Write-Output " Disabling sensors..."
212+ If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" )) {
213+ New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Force | Out-Null
214+ }
215+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableSensors" - Type DWord - Value 1
216+ }
217+
218+ # Enable sensor features
219+ Function EnableSensors {
220+ Write-Output " Enabling sensors..."
221+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableSensors" - ErrorAction SilentlyContinue
222+ }
223+
209224# Disable location feature and scripting for the location feature
210225Function DisableLocation {
211226 Write-Output " Disabling location services..."
@@ -223,28 +238,6 @@ Function EnableLocation {
223238 Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableLocationScripting" - ErrorAction SilentlyContinue
224239}
225240
226- # Disable Location Tracking
227- Function DisableLocationTracking {
228- Write-Output " Disabling Location Tracking..."
229- If (! (Test-Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" )) {
230- New-Item - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" - Force | Out-Null
231- }
232- Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" - Name " Value" - Type String - Value " Deny"
233- Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" - Name " SensorPermissionState" - Type DWord - Value 0
234- Set-ItemProperty - Path " HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" - Name " Status" - Type DWord - Value 0
235- }
236-
237- # Enable Location Tracking
238- Function EnableLocationTracking {
239- Write-Output " Enabling Location Tracking..."
240- If (! (Test-Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" )) {
241- New-Item - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" - Force | Out-Null
242- }
243- Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" - Name " Value" - Type String - Value " Allow"
244- Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" - Name " SensorPermissionState" - Type DWord - Value 1
245- Set-ItemProperty - Path " HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" - Name " Status" - Type DWord - Value 1
246- }
247-
248241# Disable automatic Maps updates
249242Function DisableMapUpdates {
250243 Write-Output " Disabling automatic Maps updates..."
@@ -1437,21 +1430,6 @@ Function ShowShutdownOnLockScreen {
14371430 Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" - Name " ShutdownWithoutLogon" - Type DWord - Value 1
14381431}
14391432
1440- # Disable sensor features, such as screen auto rotation
1441- Function DisableSensors {
1442- Write-Output " Disabling sensors..."
1443- If (! (Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" )) {
1444- New-Item - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Force | Out-Null
1445- }
1446- Set-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableSensors" - Type DWord - Value 1
1447- }
1448-
1449- # Enable sensor features
1450- Function EnableSensors {
1451- Write-Output " Enabling sensors..."
1452- Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableSensors" - ErrorAction SilentlyContinue
1453- }
1454-
14551433# Disable Lock screen Blur - Applicable since 1903
14561434Function DisableLockScreenBlur {
14571435 Write-Output " Disabling Lock screen Blur..."
@@ -3051,6 +3029,18 @@ Function EnableIEFirstRun {
30513029 Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Internet Explorer\Main" - Name " DisableFirstRunCustomize" - ErrorAction SilentlyContinue
30523030}
30533031
3032+ # Disable "Hi!" First Logon Animation (it will be replaced by "Preparing Windows" message)
3033+ Function DisableFirstLogonAnimation {
3034+ Write-Output " Disabling First Logon Animation..."
3035+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" - Name " EnableFirstLogonAnimation" - Type DWord - Value 0
3036+ }
3037+
3038+ # Enable "Hi!" First Logon Animation
3039+ Function EnableFirstLogonAnimation {
3040+ Write-Output " Enabling First Logon Animation..."
3041+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" - Name " EnableFirstLogonAnimation" - ErrorAction SilentlyContinue
3042+ }
3043+
30543044# Disable Windows Media Player's media sharing feature
30553045Function DisableMediaSharing {
30563046 Write-Output " Disabling media sharing..."
@@ -3066,18 +3056,6 @@ Function EnableMediaSharing {
30663056 Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" - Name " PreventLibrarySharing" - ErrorAction SilentlyContinue
30673057}
30683058
3069- # Disable "Hi!" First Logon Animation (it will be replaced by "Preparing Windows" message)
3070- Function DisableFirstLogonAnimation {
3071- Write-Output " Disabling First Logon Animation..."
3072- Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" - Name " EnableFirstLogonAnimation" - Type DWord - Value 0
3073- }
3074-
3075- # Enable "Hi!" First Logon Animation
3076- Function EnableFirstLogonAnimation {
3077- Write-Output " Enabling First Logon Animation..."
3078- Remove-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" - Name " EnableFirstLogonAnimation" - ErrorAction SilentlyContinue
3079- }
3080-
30813059# Uninstall Windows Media Player
30823060Function UninstallMediaPlayer {
30833061 Write-Output " Uninstalling Windows Media Player..."
0 commit comments