@@ -46,38 +46,59 @@ $EActionCenter = New-Object system.Windows.Forms.Button
46
46
$EActionCenter.text = " Enable Action Center"
47
47
$EActionCenter.width = 200
48
48
$EActionCenter.height = 30
49
- $EActionCenter.location = New-Object System.Drawing.Point(43 , 106 )
49
+ $EActionCenter.location = New-Object System.Drawing.Point(43 , 99 )
50
50
$EActionCenter.Font = New-Object System.Drawing.Font(' Microsoft Sans Serif' , 10 )
51
51
52
52
$ECortana = New-Object system.Windows.Forms.Button
53
53
$ECortana.text = " Enable Cortana"
54
54
$ECortana.width = 200
55
55
$ECortana.height = 30
56
- $ECortana.location = New-Object System.Drawing.Point(43 , 156 )
56
+ $ECortana.location = New-Object System.Drawing.Point(43 , 153 )
57
57
$ECortana.Font = New-Object System.Drawing.Font(' Microsoft Sans Serif' , 10 )
58
58
59
59
$HTrayIcons = New-Object system.Windows.Forms.Button
60
60
$HTrayIcons.text = " Hide Tray Icons"
61
61
$HTrayIcons.width = 200
62
62
$HTrayIcons.height = 30
63
- $HTrayIcons.location = New-Object System.Drawing.Point(407 , 106 )
63
+ $HTrayIcons.location = New-Object System.Drawing.Point(407 , 99 )
64
64
$HTrayIcons.Font = New-Object System.Drawing.Font(' Microsoft Sans Serif' , 10 )
65
65
66
66
$EClipboardHistory = New-Object system.Windows.Forms.Button
67
67
$EClipboardHistory.text = " Enable Clipboard History"
68
68
$EClipboardHistory.width = 200
69
69
$EClipboardHistory.height = 30
70
- $EClipboardHistory.location = New-Object System.Drawing.Point(407 , 157 )
70
+ $EClipboardHistory.location = New-Object System.Drawing.Point(407 , 151 )
71
71
$EClipboardHistory.Font = New-Object System.Drawing.Font(' Microsoft Sans Serif' , 10 )
72
72
73
73
$RWDIcon = New-Object system.Windows.Forms.Button
74
74
$RWDIcon.text = " Restore Windows Defender Icon"
75
75
$RWDIcon.width = 200
76
76
$RWDIcon.height = 45
77
- $RWDIcon.location = New-Object System.Drawing.Point(43 , 204 )
77
+ $RWDIcon.location = New-Object System.Drawing.Point(43 , 207 )
78
78
$RWDIcon.Font = New-Object System.Drawing.Font(' Microsoft Sans Serif' , 10 )
79
79
80
- $Form.controls.AddRange (@ ($PictureBox1 , $EActionCenter , $ECortana , $HTrayIcons , $EClipboardHistory , $RWDIcon ))
80
+ $ELocation = New-Object system.Windows.Forms.Button
81
+ $ELocation.text = " Enable Location"
82
+ $ELocation.width = 200
83
+ $ELocation.height = 30
84
+ $ELocation.location = New-Object System.Drawing.Point(407 , 215 )
85
+ $ELocation.Font = New-Object System.Drawing.Font(' Microsoft Sans Serif' , 10 )
86
+
87
+ $RWindowsSearch = New-Object system.Windows.Forms.Button
88
+ $RWindowsSearch.text = " Restore Windows Search"
89
+ $RWindowsSearch.width = 200
90
+ $RWindowsSearch.height = 45
91
+ $RWindowsSearch.location = New-Object System.Drawing.Point(43 , 276 )
92
+ $RWindowsSearch.Font = New-Object System.Drawing.Font(' Microsoft Sans Serif' , 10 )
93
+
94
+ $RBackgroundApps = New-Object system.Windows.Forms.Button
95
+ $RBackgroundApps.text = " Restore Background Apps"
96
+ $RBackgroundApps.width = 200
97
+ $RBackgroundApps.height = 45
98
+ $RBackgroundApps.location = New-Object System.Drawing.Point(407 , 279 )
99
+ $RBackgroundApps.Font = New-Object System.Drawing.Font(' Microsoft Sans Serif' , 10 )
100
+
101
+ $Form.controls.AddRange (@ ($PictureBox1 , $EActionCenter , $ECortana , $HTrayIcons , $EClipboardHistory , $RWDIcon , $ELocation , $RWindowsSearch , $RBackgroundApps ))
81
102
82
103
$EActionCenter.Add_Click ({
83
104
Write-Host " Enabling Action Center..."
@@ -105,6 +126,19 @@ $RWDIcon.Add_Click({
105
126
Write-Host " Done - Reverted to Stock Settings"
106
127
})
107
128
129
+ $RWindowsSearch.Add_Click ({
130
+ Write-Host " Restoring Windows Search..."
131
+ Set-ItemProperty - Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" - Name " BingSearchEnabled" - Type DWord - Value " 1"
132
+ Remove-ItemProperty - Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" - Name " CortanaConsent" - ErrorAction SilentlyContinue
133
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" - Name " DisableWebSearch" - ErrorAction SilentlyContinue
134
+ Write-Host " Restore and Starting Windows Search Service..."
135
+ Set-Service " WSearch" - StartupType Automatic
136
+ Start-Service " WSearch" - WarningAction SilentlyContinue
137
+ Write-Host " Restore Windows Search Icon..."
138
+ Set-ItemProperty - Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" - Name " SearchboxTaskbarMode" - Type DWord - Value 1
139
+ Write-Host " Done - Reverted to Stock Settings"
140
+ })
141
+
108
142
$HTrayIcons.Add_Click ({
109
143
$ErrorActionPreference = ' SilentlyContinue'
110
144
Write-Host " Hiding tray icons..."
@@ -119,4 +153,33 @@ $EClipboardHistory.Add_Click({
119
153
Write-Host " Done - Reverted to Stock Settings"
120
154
})
121
155
156
+ $ELocation.Add_Click ({
157
+ Write-Host " Enabling Location Provider..."
158
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableWindowsLocationProvider" - ErrorAction SilentlyContinue
159
+ Write-Host " Enabling Location Scripting..."
160
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableLocationScripting" - ErrorAction SilentlyContinue
161
+ Write-Host " Enabling Location..."
162
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" - Name " DisableLocation" - ErrorAction SilentlyContinue
163
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" - Name " SensorPermissionState" - ErrorAction SilentlyContinue
164
+ Set-ItemProperty - Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" - Name " Value" - Type String - Value " Allow"
165
+ Write-Host " Allow access to Location..."
166
+ Set-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" - Name " Value" - Type String - Value " Allow"
167
+ Set-ItemProperty - Path " HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" - Name " Status" - Type DWord - Value " 1"
168
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessLocation" - ErrorAction SilentlyContinue
169
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessLocation_UserInControlOfTheseApps" - ErrorAction SilentlyContinue
170
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessLocation_ForceAllowTheseApps" - ErrorAction SilentlyContinue
171
+ Remove-ItemProperty - Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" - Name " LetAppsAccessLocation_ForceDenyTheseApps" - ErrorAction SilentlyContinue
172
+ Write-Host " Done - Reverted to Stock Settings"
173
+ })
174
+
175
+ $RBackgroundApps.Add_Click ({
176
+ Write-Host " Allowing Background Apps..."
177
+ Get-ChildItem - Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" - Exclude " Microsoft.Windows.Cortana*" | ForEach {
178
+ Remove-ItemProperty - Path $_.PsPath - Name " Disabled" - ErrorAction SilentlyContinue
179
+ Remove-ItemProperty - Path $_.PsPath - Name " DisabledByUser" - ErrorAction SilentlyContinue
180
+ }
181
+ Write-Host " Done - Reverted to Stock Settings"
182
+ })
183
+
184
+
122
185
[void ]$Form.ShowDialog ()
0 commit comments