-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathRepairTweaks.ps1
More file actions
422 lines (387 loc) · 21 KB
/
RepairTweaks.ps1
File metadata and controls
422 lines (387 loc) · 21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
#repair bad tweaks by zoic
If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]'Administrator')) {
Start-Process PowerShell.exe -ArgumentList ("-NoProfile -ExecutionPolicy Bypass -File `"{0}`"" -f $PSCommandPath) -Verb RunAs
Exit
}
#global vars
$Global:currentControlSet = 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet'
$Global:controlSet001 = 'HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001'
#function to check for bad tweaks returns hastable
function checkTweaks {
#hashtable for tweaks
$tweaksTable = @{}
$tweaks = @(
'Svc Split Threshold',
'Bcdedit',
'Timer Resolution',
'Win32PrioritySeparation',
'Tcp Auto-Tuning',
'Prefetch',
'Windows Error Reporting',
'Sysmain Service',
'Ordinary DPCs',
'Spectre Meltdown Mitigations',
'HPET',
'Mouse Keyboard Queue Size',
'Csrss Priority',
'Multi-Plane Overlay',
'Memory Management',
'Raw Mouse Throttle',
'Global Timer Resolution Requests'
)
#add to hashtable
foreach ($tweak in $tweaks) {
$tweaksTable[$tweak] = $false
}
#check svc split threshold
$svcSplitCurrent = Get-ItemPropertyValue -Path "registry::$currentControlSet\Control" -Name 'SvcHostSplitThresholdInKB'
$svcSplitControl = Get-ItemPropertyValue -Path "registry::$controlSet001\Control" -Name 'SvcHostSplitThresholdInKB'
#default on server seems to be 39999 so double check for that
if (($svcSplitCurrent -ne 3670016 -or $svcSplitControl -ne 3670016) -and ($svcSplitCurrent -ne 3774873 -or $svcSplitControl -ne 3774873)) {
$tweaksTable['Svc Split Threshold'] = $true
}
#check bcdedit tweaks
$bcd = bcdedit.exe
#regEX with | for 'or'
$values = 'useplatformclock|disabledynamictick|useplatformtick|tscsyncpolicy'
if ($bcd -match $values) {
$tweaksTable['Bcdedit'] = $true
}
#check for timer res, timer res service, islc
#global scope for proper cleanup later
$Global:timerRes = Get-Process -Name TimerResolution -ErrorAction SilentlyContinue
$Global:timerResService = Get-Service -Name 'STR', 'Set Timer Resolution Service' -ErrorAction SilentlyContinue
$Global:islc = Get-Process -Name 'Intelligent standby list cleaner ISLC' -ErrorAction SilentlyContinue
if ($timerRes -or $timerResService -or $islc) {
$tweaksTable['Timer Resolution'] = $true
}
#check win32priority
$controlSetP = Get-ItemPropertyValue -Path "registry::$controlSet001\Control\PriorityControl" -Name 'Win32PrioritySeparation'
$currentControlSetP = Get-ItemPropertyValue -Path "registry::$currentControlSet\Control\PriorityControl" -Name 'Win32PrioritySeparation'
if ($currentControlSetP -ne 38 -or $controlSetP -ne 38) {
$tweaksTable['Win32PrioritySeparation'] = $true
}
#check auto-tuning
$autotuning = netsh interface tcp show global | Select-String 'Receive Window Auto-Tuning Level'
if ($autotuning -notlike '*normal*') {
$tweaksTable['Tcp Auto-Tuning'] = $true
}
#check prefetch
$prefetchCurrent = Get-ItemPropertyValue -Path "registry::$currentControlSet\Control\Session Manager\Memory Management\PrefetchParameters" -Name 'EnablePrefetcher'
$prefetchControl = Get-ItemPropertyValue -Path "registry::$controlSet001\Control\Session Manager\Memory Management\PrefetchParameters" -Name 'EnablePrefetcher'
if ($prefetchCurrent -ne 3 -or $prefetchControl -ne 3) {
$tweaksTable['Prefetch'] = $true
}
#check sysmain service (superfetch)
$start = (Get-Service -Name SysMain).StartType
if ($start -ne 'Automatic') {
$tweaksTable['Sysmain Service'] = $true
}
#check ordinary dpcs
$currentDpc = (Get-ItemProperty -Path "registry::$currentControlSet\Control\Session Manager\kernel").ThreadDpcEnable
$controlDpc = (Get-ItemProperty -Path "registry::$controlSet001\Control\Session Manager\kernel").ThreadDpcEnable
if ($currentDpc -eq 0 -or $controlDpc -eq 0) {
$tweaksTable['Ordinary DPCs'] = $true
}
#windows error reporting
$svcStart = (Get-Service -Name WerSvc).StartType
$policy = (Get-ItemProperty -Path 'registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting' -ErrorAction SilentlyContinue).Disabled
if ($svcStart -ne 'Manual' -or $policy -eq 1) {
$tweaksTable['Windows Error Reporting'] = $true
}
#check spectre and meltdown mitigations
$overrideCurrent = (Get-ItemProperty -Path "registry::$currentControlSet\Control\Session Manager\Memory Management").FeatureSettingsOverride
$overrideMaskCurrent = (Get-ItemProperty -Path "registry::$currentControlSet\Control\Session Manager\Memory Management").FeatureSettingsOverrideMask
$overrideControl = (Get-ItemProperty -Path "registry::$controlSet001\Control\Session Manager\Memory Management").FeatureSettingsOverride
$overrideMaskControl = (Get-ItemProperty -Path "registry::$controlSet001\Control\Session Manager\Memory Management").FeatureSettingsOverrideMask
if ($overrideCurrent -eq 3 -or $overrideMaskCurrent -eq 3 -or $overrideControl -eq 3 -or $overrideMaskControl -eq 3) {
$tweaksTable['Spectre Meltdown Mitigations'] = $true
}
#check High precision event timer
$status = (Get-PnpDevice -InstanceId 'ACPI\PNP0103\*').Status
if ($status -ne 'OK' -and $status) {
$tweaksTable['HPET'] = $true
}
#check mouse and keyboard queue size
#use try and catch when value doesnt exist
try {
$keyboardCurrent = Get-ItemPropertyValue -Path "registry::$currentControlSet\Services\kbdclass\Parameters" -Name 'KeyboardDataQueueSize' -ErrorAction SilentlyContinue
}
catch {
#hide error
}
try {
$mouseCurrent = Get-ItemPropertyValue -Path "registry::$currentControlSet\Services\mouclass\Parameters" -Name 'MouseDataQueueSize' -ErrorAction SilentlyContinue
}
catch {
#hide error
}
try {
$keyboardControl = Get-ItemPropertyValue -Path "registry::$controlSet001\Services\kbdclass\Parameters" -Name 'KeyboardDataQueueSize' -ErrorAction SilentlyContinue
}
catch {
#hide error
}
try {
$mouseControl = Get-ItemPropertyValue -Path "registry::$controlSet001\Services\mouclass\Parameters" -Name 'MouseDataQueueSize' -ErrorAction SilentlyContinue
}
catch {
#hide error
}
#if value is null that is fine too (default value 100)
if ($keyboardCurrent) {
if ($keyboardCurrent -ne 100) {
$tweaksTable['Mouse Keyboard Queue Size'] = $true
}
}
if ($mouseCurrent) {
if ($mouseCurrent -ne 100) {
$tweaksTable['Mouse Keyboard Queue Size'] = $true
}
}
if ($keyboardControl) {
if ($keyboardControl -ne 100) {
$tweaksTable['Mouse Keyboard Queue Size'] = $true
}
}
if ($mouseControl) {
if ($mouseControl -ne 100) {
$tweaksTable['Mouse Keyboard Queue Size'] = $true
}
}
#check csrss priority
if (Test-Path -Path 'registry::HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\csrss.exe\PerfOptions' -ErrorAction SilentlyContinue) {
$tweaksTable['Csrss Priority'] = $true
}
#check mpo disabled
if (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\Dwm' -Name 'OverlayTestMode' -ErrorAction SilentlyContinue) {
$tweaksTable['Multi-Plane Overlay'] = $true
}
#check Memory Management
#theres lots of possible reg keys here so as long as one of them is applied ill assume most of them are also exist
$memPath = 'HKLM:\System\CurrentControlSet\Control\Session Manager\Memory Management'
$defaultValues = @(
'ClearPageFileAtShutdown'
'DisablePagingExecutive'
'LargeSystemCache'
'NonPagedPoolQuota'
'NonPagedPoolSize'
'PagedPoolQuota'
'PagedPoolSize'
)
$keys = Get-ItemProperty $memPath
foreach ($value in $defaultValues) {
#if any one of these is not 0 its been changed
if ($keys.$value -ne 0) {
$tweaksTable['Memory Management'] = $true
}
}
#check others
if (Get-ItemProperty $memPath -Name 'IoPageLockLimit' -ErrorAction SilentlyContinue) {
$tweaksTable['Memory Management'] = $true
}
if (Get-ItemProperty $memPath -Name 'CacheUnmapBehindLengthInMB' -ErrorAction SilentlyContinue) {
$tweaksTable['Memory Management'] = $true
}
#check raw mouse throttle
if (Get-ItemProperty 'HKCU:\Control Panel\Mouse' -Name 'RawMouseThrottleEnabled' -ErrorAction SilentlyContinue) {
$tweaksTable['Raw Mouse Throttle'] = $true
}
#global timer requests
if (Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\kernel' -Name 'GlobalTimerResolutionRequests' -ErrorAction SilentlyContinue) {
$tweaksTable['Global Timer Resolution Requests'] = $true
}
return $tweaksTable
}
#pass string array
function repairTweaks($tweakNames) {
foreach ($tweak in $tweakNames) {
#repair superfetch
if ($tweak -eq 'Sysmain Service') {
Set-Service -Name SysMain -StartupType Automatic
}
#repair threaded dpcs
if ($tweak -eq 'Ordinary DPCs') {
Remove-ItemProperty -Path "registry::$currentControlSet\Control\Session Manager\kernel" -Name ThreadDpcEnable -Force -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "registry::$controlSet001\Control\Session Manager\kernel" -Name ThreadDpcEnable -Force -ErrorAction SilentlyContinue
}
#repair hpet
if ($tweak -eq 'HPET') {
Get-PnpDevice -InstanceId 'ACPI\PNP0103\*' | Enable-PnpDevice -Confirm:$false
}
#repair mouse keyboard queue size
if ($tweak -eq 'Mouse Keyboard Queue Size') {
Reg.exe add 'HKLM\SYSTEM\CurrentControlSet\Services\kbdclass\Parameters' /v 'KeyboardDataQueueSize' /t REG_DWORD /d '100' /f *>$null
Reg.exe add 'HKLM\SYSTEM\ControlSet001\Services\kbdclass\Parameters' /v 'KeyboardDataQueueSize' /t REG_DWORD /d '100' /f *>$null
Reg.exe add 'HKLM\SYSTEM\CurrentControlSet\Services\mouclass\Parameters' /v 'MouseDataQueueSize' /t REG_DWORD /d '100' /f *>$null
Reg.exe add 'HKLM\SYSTEM\ControlSet001\Services\mouclass\Parameters' /v 'MouseDataQueueSize' /t REG_DWORD /d '100' /f *>$null
}
#repair timer res
if ($tweak -eq 'Timer Resolution') {
#cleanup timer res depending on which is being used
if ($timerRes) {
$filePath = (Get-Process -Name TimerResolution -FileVersionInfo).FileName
Stop-Process -Name TimerResolution -Force
Remove-Item -Path $filePath -Force
}
if ($timerResService) {
$name = (Get-Service -Name 'Set Timer Resolution Service', 'STR' -ErrorAction SilentlyContinue).Name
$serviceExePath = (Get-Process -Name SetTimerResolutionService -FileVersionInfo).FileName
Stop-Service -Name $name -Force
Stop-Process -Name SetTimerResolutionService -Force -ErrorAction SilentlyContinue
sc.exe delete $name *>$null
Remove-Item -Path $serviceExePath -Force
}
if ($islc) {
$filePath = (Get-Process -Name 'Intelligent standby list cleaner ISLC' -FileVersionInfo).FileName
Stop-Process -Name 'Intelligent standby list cleaner ISLC' -Force
Remove-Item -Path $filePath -Force
}
}
#repair svc split threshold
if ($tweak -eq 'Svc Split Threshold') {
Reg.exe add 'HKLM\SYSTEM\ControlSet001\Control' /v 'SvcHostSplitThresholdInKB' /t REG_DWORD /d '3670016' /f *>$null
Reg.exe add 'HKLM\SYSTEM\CurrentControlSet\Control' /v 'SvcHostSplitThresholdInKB' /t REG_DWORD /d '3670016' /f *>$null
}
#repair bcdedit
if ($tweak -eq 'Bcdedit') {
bcdedit.exe /deletevalue useplatformclock *>$null
bcdedit.exe /deletevalue disabledynamictick *>$null
bcdedit.exe /deletevalue useplatformtick *>$null
bcdedit.exe /deletevalue tscsyncpolicy *>$null
}
#repair prefetch
if ($tweak -eq 'Prefetch') {
Reg.exe add 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters' /v 'EnablePrefetcher' /t REG_DWORD /d '3' /f *>$null
Reg.exe add 'HKLM\SYSTEM\ControlSet001\Control\Session Manager\Memory Management\PrefetchParameters' /v 'EnablePrefetcher' /t REG_DWORD /d '3' /f *>$null
}
#repair win32priorityseperation
if ($tweak -eq 'Win32PrioritySeparation') {
Reg.exe add 'HKLM\SYSTEM\ControlSet001\Control\PriorityControl' /v 'Win32PrioritySeparation' /t REG_DWORD /d '38' /f *>$null
Reg.exe add 'HKLM\SYSTEM\CurrentControlSet\Control\PriorityControl' /v 'Win32PrioritySeparation' /t REG_DWORD /d '38' /f *>$null
}
#repair tcp autotuning
if ($tweak -eq 'Tcp Auto-Tuning') {
netsh.exe interface tcp set global autotuninglevel=normal *>$null
}
#repair spectre meltdown
if ($tweak -eq 'Spectre Meltdown Mitigations') {
Remove-ItemProperty -Path "registry::$currentControlSet\Control\Session Manager\Memory Management" -Name FeatureSettingsOverride -Force -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "registry::$controlSet001\Control\Session Manager\Memory Management" -Name FeatureSettingsOverride -Force -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "registry::$currentControlSet\Control\Session Manager\Memory Management" -Name FeatureSettingsOverrideMask -Force -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "registry::$controlSet001\Control\Session Manager\Memory Management" -Name FeatureSettingsOverrideMask -Force -ErrorAction SilentlyContinue
}
#repair windows error reporting
if ($tweak -eq 'Windows Error Reporting') {
Set-Service -Name WerSvc -StartupType Manual -Force
Remove-ItemProperty -Path 'registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting' -Name 'Disabled' -Force -ErrorAction SilentlyContinue
}
#repair csrss priority
if ($tweak -eq 'Csrss Priority') {
Remove-Item -Path 'registry::HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\csrss.exe\PerfOptions' -Recurse -Force
}
#repair mpo
if ($tweak -eq 'Multi-Plane Overlay') {
Remove-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Dwm' -Name 'OverlayTestMode' -Force
}
#repair mem mangement
#try to set it as close to default as possible
if ($tweak -eq 'Memory Management') {
Reg.exe add 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' /v 'ClearPageFileAtShutdown' /t REG_DWORD /d '0' /f *>$null
Reg.exe add 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' /v 'DisablePagingExecutive' /t REG_DWORD /d '0' /f *>$null
Reg.exe add 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' /v 'LargeSystemCache' /t REG_DWORD /d '0' /f *>$null
Reg.exe add 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' /v 'NonPagedPoolQuota' /t REG_DWORD /d '0' /f *>$null
Reg.exe add 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' /v 'NonPagedPoolSize' /t REG_DWORD /d '0' /f *>$null
Reg.exe add 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' /v 'PagedPoolQuota' /t REG_DWORD /d '0' /f *>$null
Reg.exe add 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' /v 'PagedPoolSize' /t REG_DWORD /d '0' /f *>$null
Reg.exe add 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' /v 'SecondLevelDataCache' /t REG_DWORD /d '0' /f *>$null
Reg.exe add 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' /v 'SystemPages' /t REG_DWORD /d '0' /f *>$null
Reg.exe delete 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' /v 'IoPageLockLimit' /f *>$null
Reg.exe delete 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' /v 'CacheUnmapBehindLengthInMB' /f *>$null
Reg.exe delete 'HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management' /v 'SimulateCommitSavings' /f *>$null
Reg.exe delete 'HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management' /v 'TrackLockedPages' /f *>$null
Reg.exe delete 'HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management' /v 'TrackPtes' /f *>$null
Reg.exe delete 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' /v 'DynamicMemory' /f *>$null
Reg.exe delete 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' /v 'EnforceWriteProtection' /f *>$null
Reg.exe delete 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' /v 'MakeLowMemory' /f *>$null
Reg.exe delete 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' /v 'SystemCacheLimit' /f *>$null
Reg.exe delete 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' /v 'SessionSpaceLimit' /f *>$null
Reg.exe delete 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' /v 'WriteWatch' /f *>$null
Reg.exe delete 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' /v 'SnapUnloads' /f *>$null
Reg.exe delete 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' /v 'MapAllocationFragment'/f *>$null
Reg.exe delete 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' /v 'Mirroring' /f *>$null
Reg.exe delete 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' /v 'DontVerifyRandomDrivers' /f *>$null #lmao wtf is this key
Reg.exe delete 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' /v 'EnableLowVaAccess' /f *>$null
}
#repair mouse throttle
if ($tweak -eq 'Raw Mouse Throttle') {
reg.exe delete 'HKCU\Control Panel\Mouse' /v 'RawMouseThrottleEnabled' /f *>$null
reg.exe delete 'HKCU\Control Panel\Mouse' /v 'RawMouseThrottleForced' /f *>$null
reg.exe delete 'HKCU\Control Panel\Mouse' /v 'RawMouseThrottleDuration' /f *>$null
reg.exe delete 'HKCU\Control Panel\Mouse' /v 'RawMouseThrottleLeeway' /f *>$null
}
#repair global timer requests
if ($tweak -eq 'Global Timer Resolution Requests') {
reg.exe delete 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel' /v 'GlobalTimerResolutionRequests' /f *>$null
}
}
}
Write-Host 'Checking For Bad Tweaks...'
$getTweaks = checkTweaks
$trueCount = 0
$badTweaksName = @()
foreach ($tweak in $getTweaks.GetEnumerator()) {
#if bad tweak is found
if ($tweak.Value) {
$badTweaksName += $tweak.Key
Write-Host "[$($tweak.Key)]" -ForegroundColor Red
}
else {
$trueCount++
Write-Host "[$($tweak.Key)]" -ForegroundColor Green
}
}
#no bad tweaks found
if ($trueCount -eq $getTweaks.Count) {
Write-Host 'No Bad Tweaks Found!'
$input = Read-Host 'Press ANY Key to Exit...'
if ($input) {
exit
}
}
else {
#use choice cmdlet
choice.exe /c yn /n /m 'Press Y to Repair Bad Tweaks (N to SKIP)'
if ($LASTEXITCODE -eq 1) {
repairTweaks $badTweaksName
#call check tweaks to confirm they have been repaired
$getTweaks = checkTweaks
$trueCount = 0
$badTweaksName = @()
foreach ($tweak in $getTweaks.GetEnumerator()) {
#if bad tweak is found
if ($tweak.Value) {
$badTweaksName += $tweak.Key
}
else {
$trueCount++
}
}
if ($trueCount -eq $getTweaks.Count) {
Write-Host 'Tweaks Repaired Successfully!'
$input = Read-Host 'Press ANY Key to Exit...'
if ($input) {
exit
}
}
else {
Write-Host 'Tweaks Not Repaired:'
foreach ($name in $badTweaksName) {
Write-Host "[$($name)]" -ForegroundColor Red
}
}
}
else {
exit
}
}