forked from DaddyMadu/Windows10GamingFocus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
win10debloatandgamingtweaks.ps1
3536 lines (3243 loc) · 214 KB
/
win10debloatandgamingtweaks.ps1
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
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
##########
# Master Branch : https://github.com/ChrisTitusTech/win10script
# Current Author : Daddy Madu
# Current Author Source: https://github.com/DaddyMadu/Windows10GamingFocus
#
# Note from author: Never run scripts without reading them & understanding what they do.
#
# Addition: One command to rule them all, One command to find it, and One command to Run it!
#
# > powershell -nop -c "iex(New-Object Net.WebClient).DownloadString('http://madu.gg/ps')"
#
# Changelogs Moved to ReadMe File for better mangement.
#
##########
$host.ui.RawUI.WindowTitle = "DaddyMadu Ultimate Windows Debloater and Gaming Focus Tweaker"
cmd /c 'title [DaddyMadu Ultimate Windows Debloater and Gaming Focus Tweaker]'
Write-Host 'Welcome to DaddyMadu Ultimate Windows Debloater and Gaming Focus Tweaker';
Write-Host "Please DISABLE your ANTIVIRUS to prevent any issues and PRESS any KEY to Continue!" -ForegroundColor Red -BackgroundColor Black
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-Null
$currentexename = (([Diagnostics.Process]::GetCurrentProcess().ProcessName) + '.exe')
if ($currentexename -eq "pwsh.exe") {
Start-Process Powershell -Argumentlist '-ExecutionPolicy bypass -NoProfile -command "irm "https://github.com/DaddyMadu/Windows10GamingFocus/raw/master/win10debloatandgamingtweaks.ps1" | iex"' -Verb RunAs
exit
}
Clear-Host
# Desktop presets
$tweaks = @(
### Require administrator privileges ###
"RequireAdmin",
"CreateRestorePoint",
### Chris Titus Tech Additions
"SlowUpdatesTweaks",
"Write-ColorOutput", #Utilizing Colors for better Warning messages!
"InstallTitusProgs", #REQUIRED FOR OTHER PROGRAM INSTALLS!
"InstallMVC", #DaddyMadu install Microsoft Visualstudio required for HPET service!
"Install7Zip",
"InstallChocoUpdates",
"EnableUlimatePower", # DaddyMadu don't change order it will break other functions! just disable if you want with #
### DaddyMadu Windows Defender Settings! Don't Change Order Just Disable with # If You Don't want it ###
"MSIMode", #Enable Or Disable MSI Mode For Supported Cards, WARNING ENABLING MSI MODE MIGHT CRUSH YOUR SYSTEM! IF IT HAPPENS PLEASE RESTORE LAST WORKING SYSTEM RESTORE POINT AND DON'T ENABLE MSI MODE ON THIS SYSTEM AGAIN!
"askDefender",
"DorEOneDrive", #Option to Install Or Uninstall Microsoft One Drive!
"askXBOX",
"Windows11Extra",
### Windows Apps
"DebloatAll",
### Privacy Tweaks ###
"DisableTelemetry", # "EnableTelemetry",
"DisableWiFiSense", # "EnableWiFiSense",
"DisableSmartScreen", # "EnableSmartScreen",
"DisableWebSearch", # "EnableWebSearch",
"DisableAppSuggestions", # "EnableAppSuggestions",
"DisableActivityHistory", # "EnableActivityHistory",
"EnableBackgroundApps", #"DisableBackgroundApps",
"DisableLocationTracking", # "EnableLocationTracking",
"DisableMapUpdates", # "EnableMapUpdates",
"DisableFeedback", # "EnableFeedback",
"DisableTailoredExperiences", # "EnableTailoredExperiences",
"DisableAdvertisingID", # "EnableAdvertisingID",
"DisableCortana", # "EnableCortana",
"DisableErrorReporting", # "EnableErrorReporting",
"SetP2PUpdateLocal", # "SetP2PUpdateInternet",
"DisableDiagTrack", # "EnableDiagTrack",
"DisableWAPPush", # "EnableWAPPush",
"DisableNewsFeed",
### Security Tweaks ###
"SetUACLow", # "SetUACHigh",
# "EnableSharingMappedDrives", # "DisableSharingMappedDrives",
# "DisableAdminShares", # "EnableAdminShares",
"DisableSMB1", # "EnableSMB1",
# "DisableSMBServer", # "EnableSMBServer",
# "DisableLLMNR", # "EnableLLMNR",
"SetCurrentNetworkPrivate", # "SetCurrentNetworkPublic",
"SetUnknownNetworksPrivate", # "SetUnknownNetworksPublic",
"DisableNetDevicesAutoInst", # "EnableNetDevicesAutoInst",
"EnableF8BootMenu", # "DisableF8BootMenu",
#"SetDEPOptOut", # "SetDEPOptIn",
# "EnableCIMemoryIntegrity", # "DisableCIMemoryIntegrity",
#"DisableScriptHost", # "EnableScriptHost",
#"EnableDotNetStrongCrypto", # "DisableDotNetStrongCrypto",
"DisableMeltdownCompatFlag", # "EnableMeltdownCompatFlag"
### Service Tweaks ###
"EnableUpdateMSRT", # "EnableUpdateMSRT", #"DisableUpdateMSRT",
"EnableUpdateDriver", # "EnableUpdateDriver", #"DisableUpdateDriver",
"DisableUpdateRestart", # "EnableUpdateRestart",
"DisableHomeGroups", # "EnableHomeGroups",
"EnableSharedExperiences", # "SharedExperiences",
"DisableRemoteAssistance", # "EnableRemoteAssistance",
"EnableRemoteDesktop", # "DisableRemoteDesktop",
"DisableAutoplay", # "EnableAutoplay",
"DisableAutorun", # "EnableAutorun",
"DisableStorageSense", # "EnableStorageSense",
"DisableDefragmentation", # "EnableDefragmentation",
"DisableSuperfetch", # "EnableSuperfetch",
"EnableIndexing",
"SetBIOSTimeUTC", #"SetBIOSTimeUTC", #"SetBIOSTimeLocal",
"DisableHibernation", # "EnableHibernation",
"EnableSleepButton", # "DisableSleepButton",
"DisableSleepTimeout", # "EnableSleepTimeout",
"DisableFastStartup", # "EnableFastStartup",
"DISGaming",
### Windows Tweaks ###
"PowerThrottlingOff",
"Win32PrioritySeparation",
"DisableAERO",
"BSODdetails",
"Disablelivetiles",
"wallpaperquality",
"DisableShistory",
"Disableshortcutword",
"DisableMouseKKS",
"DisableTransparency",
"TurnOffSafeSearch",
"DisableCloudSearch",
"DisableDeviceHistory",
"DisableSearchHistroy",
"RemoveMeet",
### UI Tweaks ###
"EnableActionCenter", # "DisableActionCenter",
"EnableLockScreen", # "DisableLockScreen",
"EnableLockScreenRS1", # "DisableLockScreenRS1",
# "HideNetworkFromLockScreen", # "ShowNetworkOnLockScreen",
# "HideShutdownFromLockScreen", # "ShowShutdownOnLockScreen",
"DisableStickyKeys", # "EnableStickyKeys",
"ShowTaskManagerDetails" # "HideTaskManagerDetails",
"ShowFileOperationsDetails", # "HideFileOperationsDetails",
"DisableFileDeleteConfirm", # "EnableFileDeleteConfirm",
"HideTaskbarSearch",
#"ShowTaskbarSearchIcon", # "ShowTaskbarSearchBox",
"HideTaskView", # "ShowTaskView",
# "ShowSmallTaskbarIcons", # "ShowLargeTaskbarIcons",
# "SetTaskbarCombineWhenFull", # "SetTaskbarCombineNever", # "SetTaskbarCombineAlways",
"HideTaskbarPeopleIcon", # "ShowTaskbarPeopleIcon",
#"HideTrayIcons", #"ShowTrayIcons",
"DisableSearchAppInStore", # "EnableSearchAppInStore",
"DisableNewAppPrompt", # "EnableNewAppPrompt",
# "SetControlPanelSmallIcons", # "SetControlPanelLargeIcons", # "SetControlPanelCategories",
"SetVisualFXPerformance", # "SetVisualFXAppearance",
# "AddENKeyboard", # "RemoveENKeyboard",
"EnableNumlock", # "DisableNumlock",
"EnableDarkMode", # "DisableDarkMode",
### Explorer UI Tweaks ###
"ShowKnownExtensions", # "HideKnownExtensions",
"HideHiddenFiles",
"HideSyncNotifications" # "ShowSyncNotifications",
"HideRecentShortcuts", # "ShowRecentShortcuts",
"SetExplorerThisPC", # "SetExplorerQuickAccess",
"ShowThisPCOnDesktop", # "HideThisPCFromDesktop",
"ShowUserFolderOnDesktop", # "HideUserFolderFromDesktop",
"Hide3DObjectsFromThisPC", # "Show3DObjectsInThisPC",
"Hide3DObjectsFromExplorer", # "Show3DObjectsInExplorer",
"EnableThumbnails", # "EnableThumbnails", # "DisableThumbnails",
"EnableThumbsDB", # "EnableThumbsDB", # "DisableThumbsDB",
### Application Tweaks ###
#"UninstallMediaPlayer", #"InstallMediaPlayer",
"UninstallInternetExplorer", # "InstallInternetExplorer",
"UninstallWorkFolders", # "InstallWorkFolders",
"UninstallLinuxSubsystem", # "UninstallLinuxSubsystem", #"InstallLinuxSubsystem",
# "InstallHyperV", # "UninstallHyperV",
"SetPhotoViewerAssociation", # "UnsetPhotoViewerAssociation",
"AddPhotoViewerOpenWith", # "RemovePhotoViewerOpenWith",
"InstallPDFPrinter", # "UninstallPDFPrinter",
"SVCHostTweak",
### Unpinning ###
"UnpinStartMenuTiles",
### DaddyMadu Quality Of Life Tweaks ###
"QOL",
### DaddyMadu Gaming Tweaks ###
"FullscreenOptimizationFIX",
"GameOptimizationFIX",
"ApplyPCOptimizations",
"RawMouseInput",
"DetectnApplyMouseFIX",
"DisableHPET",
"EnableGameMode",
"EnableHAGS",
"DisableCoreParking",
"DisableDMA",
"DisablePKM",
"DisallowDIP",
"UseBigM",
"ForceContiguousM",
"DecreaseMKBuffer",
"StophighDPC",
"NvidiaTweaks",
"AMDGPUTweaks",
"NetworkAdapterRSS",
"NetworkOptimizations",
"DisableNagle",
"RemoveEdit3D",
"FixURLext", # fix issue with games shortcut that created by games lunchers turned white!
"UltimateCleaner",
"Finished"
### Auxiliary Functions ###
)
#Mobile Devices presets.
$mobiletweaks = @(
### Require administrator privileges ###
"RequireAdmin",
"CreateRestorePoint",
### Chris Titus Tech Additions
"SlowUpdatesTweaks",
"Write-ColorOutput", #Utilizing Colors for better Warning messages!
"InstallTitusProgs", #REQUIRED FOR OTHER PROGRAM INSTALLS!
"InstallMVC", #DaddyMadu install Microsoft Visualstudio required for HPET service!
"Install7Zip",
"InstallChocoUpdates",
"EnableUlimatePower", # DaddyMadu don't change order it will break other functions! just disable if you want with #
### DaddyMadu Windows Defender Settings! Don't Change Order Just Disable with # If You Don't want it ###
"MSIMode", #Enable Or Disable MSI Mode For Supported Cards, WARNING ENABLING MSI MODE MIGHT CRUSH YOUR SYSTEM! IF IT HAPPENS PLEASE RESTORE LAST WORKING SYSTEM RESTORE POINT AND DON'T ENABLE MSI MODE ON THIS SYSTEM AGAIN!
"askDefender",
"DorEOneDrive", #Option to Install Or Uninstall Microsoft One Drive!
"askXBOX",
"Windows11Extra",
### Windows Apps
"DebloatAll",
### Privacy Tweaks ###
"DisableTelemetry", # "EnableTelemetry",
"DisableWiFiSense", # "EnableWiFiSense",
"DisableSmartScreen", # "EnableSmartScreen",
"DisableWebSearch", # "EnableWebSearch",
"DisableAppSuggestions", # "EnableAppSuggestions",
"DisableActivityHistory", # "EnableActivityHistory",
"EnableBackgroundApps", #"DisableBackgroundApps",
"DisableLocationTracking", # "EnableLocationTracking",
"DisableMapUpdates", # "EnableMapUpdates",
"DisableFeedback", # "EnableFeedback",
"DisableTailoredExperiences", # "EnableTailoredExperiences",
"DisableAdvertisingID", # "EnableAdvertisingID",
"DisableCortana", # "EnableCortana",
"DisableErrorReporting", # "EnableErrorReporting",
"SetP2PUpdateLocal", # "SetP2PUpdateInternet",
"DisableDiagTrack", # "EnableDiagTrack",
"DisableWAPPush", # "EnableWAPPush",
"DisableNewsFeed",
### Security Tweaks ###
"SetUACLow", # "SetUACHigh",
# "EnableSharingMappedDrives", # "DisableSharingMappedDrives",
# "DisableAdminShares", # "EnableAdminShares",
"DisableSMB1", # "EnableSMB1",
# "DisableSMBServer", # "EnableSMBServer",
# "DisableLLMNR", # "EnableLLMNR",
"SetCurrentNetworkPrivate", # "SetCurrentNetworkPublic",
"SetUnknownNetworksPrivate", # "SetUnknownNetworksPublic",
"DisableNetDevicesAutoInst", # "EnableNetDevicesAutoInst",
"EnableF8BootMenu", # "DisableF8BootMenu",
#"SetDEPOptOut", # "SetDEPOptIn",
# "EnableCIMemoryIntegrity", # "DisableCIMemoryIntegrity",
#"DisableScriptHost", # "EnableScriptHost",
#"EnableDotNetStrongCrypto", # "DisableDotNetStrongCrypto",
"DisableMeltdownCompatFlag", # "EnableMeltdownCompatFlag"
### Service Tweaks ###
"EnableUpdateMSRT", # "EnableUpdateMSRT", #"DisableUpdateMSRT",
"EnableUpdateDriver", # "EnableUpdateDriver", #"DisableUpdateDriver",
"DisableUpdateRestart", # "EnableUpdateRestart",
"DisableHomeGroups", # "EnableHomeGroups",
"EnableSharedExperiences", # "SharedExperiences",
"DisableRemoteAssistance", # "EnableRemoteAssistance",
"EnableRemoteDesktop", # "DisableRemoteDesktop",
"DisableAutoplay", # "EnableAutoplay",
"DisableAutorun", # "EnableAutorun",
"DisableStorageSense", # "EnableStorageSense",
"DisableDefragmentation", # "EnableDefragmentation",
"DisableSuperfetch", # "EnableSuperfetch",
"EnableIndexing",
"SetBIOSTimeUTC", #"SetBIOSTimeUTC", #"SetBIOSTimeLocal",
"DisableHibernation", # "EnableHibernation",
"EnableSleepButton", # "DisableSleepButton",
"DisableSleepTimeout", # "EnableSleepTimeout",
"DisableFastStartup", # "EnableFastStartup",
"DISGaming",
### Windows Tweaks ###
"PowerThrottlingOff",
"Win32PrioritySeparation",
"DisableAERO",
"BSODdetails",
"Disablelivetiles",
"wallpaperquality",
"DisableShistory",
"Disableshortcutword",
"DisableMouseKKS",
"DisableTransparency",
"TurnOffSafeSearch",
"DisableCloudSearch",
"DisableDeviceHistory",
"DisableSearchHistroy",
"RemoveMeet",
### UI Tweaks ###
"EnableActionCenter", # "DisableActionCenter",
"EnableLockScreen", # "DisableLockScreen",
"EnableLockScreenRS1", # "DisableLockScreenRS1",
# "HideNetworkFromLockScreen", # "ShowNetworkOnLockScreen",
# "HideShutdownFromLockScreen", # "ShowShutdownOnLockScreen",
"DisableStickyKeys", # "EnableStickyKeys",
"ShowTaskManagerDetails" # "HideTaskManagerDetails",
"ShowFileOperationsDetails", # "HideFileOperationsDetails",
"DisableFileDeleteConfirm", # "EnableFileDeleteConfirm",
"HideTaskbarSearch",
#"ShowTaskbarSearchIcon", # "ShowTaskbarSearchBox",
"HideTaskView", # "ShowTaskView",
# "ShowSmallTaskbarIcons", # "ShowLargeTaskbarIcons",
# "SetTaskbarCombineWhenFull", # "SetTaskbarCombineNever", # "SetTaskbarCombineAlways",
"HideTaskbarPeopleIcon", # "ShowTaskbarPeopleIcon",
#"HideTrayIcons", #"ShowTrayIcons",
"DisableSearchAppInStore", # "EnableSearchAppInStore",
"DisableNewAppPrompt", # "EnableNewAppPrompt",
# "SetControlPanelSmallIcons", # "SetControlPanelLargeIcons", # "SetControlPanelCategories",
"SetVisualFXPerformance", # "SetVisualFXAppearance",
# "AddENKeyboard", # "RemoveENKeyboard",
"EnableNumlock", # "DisableNumlock",
"EnableDarkMode", # "DisableDarkMode",
### Explorer UI Tweaks ###
"ShowKnownExtensions", # "HideKnownExtensions",
"HideHiddenFiles",
"HideSyncNotifications" # "ShowSyncNotifications",
"HideRecentShortcuts", # "ShowRecentShortcuts",
"SetExplorerThisPC", # "SetExplorerQuickAccess",
"ShowThisPCOnDesktop", # "HideThisPCFromDesktop",
"ShowUserFolderOnDesktop", # "HideUserFolderFromDesktop",
"Hide3DObjectsFromThisPC", # "Show3DObjectsInThisPC",
"Hide3DObjectsFromExplorer", # "Show3DObjectsInExplorer",
"EnableThumbnails", # "EnableThumbnails", # "DisableThumbnails",
"EnableThumbsDB", # "EnableThumbsDB", # "DisableThumbsDB",
### Application Tweaks ###
#"UninstallMediaPlayer", #"InstallMediaPlayer",
"UninstallInternetExplorer", # "InstallInternetExplorer",
"UninstallWorkFolders", # "InstallWorkFolders",
"UninstallLinuxSubsystem", # "UninstallLinuxSubsystem", #"InstallLinuxSubsystem",
# "InstallHyperV", # "UninstallHyperV",
"SetPhotoViewerAssociation", # "UnsetPhotoViewerAssociation",
"AddPhotoViewerOpenWith", # "RemovePhotoViewerOpenWith",
"InstallPDFPrinter", # "UninstallPDFPrinter",
"SVCHostTweak",
### Unpinning ###
"UnpinStartMenuTiles",
### DaddyMadu Quality Of Life Tweaks ###
"QOL",
### DaddyMadu Gaming Tweaks ###
"FullscreenOptimizationFIX",
"GameOptimizationFIX",
"ApplyPCOptimizations",
"RawMouseInput",
"DetectnApplyMouseFIX",
"DisableHPET",
"EnableGameMode",
"EnableHAGS",
"DisableCoreParking",
"DisableDMA",
"DisablePKM",
"DisallowDIP",
"UseBigM",
"ForceContiguousM",
"DecreaseMKBuffer",
"StophighDPC",
"NvidiaTweaks",
"AMDGPUTweaks",
"NetworkAdapterRSS",
"NetworkOptimizations",
"DisableNagle",
"RemoveEdit3D",
"FixURLext", # fix issue with games shortcut that created by games lunchers turned white!
"UltimateCleaner",
"Finished"
### Auxiliary Functions ###
)
#########
# Pre Customizations
#########
function Show-Choco-Menu {
param(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$Title,
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$ChocoInstall
)
do
{
Clear-Host
Write-Host "================ $Title ================"
Write-Host "Y: Press 'Y' to do this."
Write-Host "2: Press 'N' to skip this."
Write-Host "Q: Press 'Q' to stop the entire script."
$selection = Read-Host "Please make a selection"
switch ($selection)
{
'y' { choco install $ChocoInstall -y }
'n' { Break }
'q' { Exit }
}
}
until ($selection -match "y" -or $selection -match "n" -or $selection -match "q")
}
Function SlowUpdatesTweaks {
Write-Output "Improving Windows Update to delay Feature updates and only install Security Updates"
### Fix Windows Update to delay feature updates and only update at certain times
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "DeferFeatureUpdates" -Type DWord -Value 1 -ErrorAction SilentlyContinue | Out-Null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "DeferQualityUpdates" -Type DWord -Value 1 -ErrorAction SilentlyContinue | Out-Null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "DeferFeatureUpdatesPeriodInDays" -Type DWord -Value 30d -ErrorAction SilentlyContinue | Out-Null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "DeferQualityUpdatesPeriodInDays" -Type DWord -Value 4d -ErrorAction SilentlyContinue | Out-Null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "PauseFeatureUpdatesStartTime" -Type String -Value "" -ErrorAction SilentlyContinue | Out-Null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "PauseQualityUpdatesStartTime" -Type String -Value "" -ErrorAction SilentlyContinue | Out-Null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "ActiveHoursEnd" -Type DWord -Value 2 -ErrorAction SilentlyContinue | Out-Null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "ActiveHoursStart" -Type DWord -Value 8 -ErrorAction SilentlyContinue | Out-Null
}
#Utilizing Clolors For Better Warning Messages!
function Write-ColorOutput
{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$False,Position=1,ValueFromPipeline=$True,ValueFromPipelinebyPropertyName=$True)][Object] $Object,
[Parameter(Mandatory=$False,Position=2,ValueFromPipeline=$True,ValueFromPipelinebyPropertyName=$True)][ConsoleColor] $ForegroundColor,
[Parameter(Mandatory=$False,Position=3,ValueFromPipeline=$True,ValueFromPipelinebyPropertyName=$True)][ConsoleColor] $BackgroundColor,
[Switch]$NoNewline
)
# Save previous colors
$previousForegroundColor = $host.UI.RawUI.ForegroundColor
$previousBackgroundColor = $host.UI.RawUI.BackgroundColor
# Set BackgroundColor if available
if($BackgroundColor -ne $null)
{
$host.UI.RawUI.BackgroundColor = $BackgroundColor
}
# Set $ForegroundColor if available
if($ForegroundColor -ne $null)
{
$host.UI.RawUI.ForegroundColor = $ForegroundColor
}
# Always write (if we want just a NewLine)
if($null -eq $Object)
{
$Object = ""
}
if($NoNewline)
{
[Console]::Write($Object)
}
else
{
Write-Output $Object
}
# Restore previous colors
$host.UI.RawUI.ForegroundColor = $previousForegroundColor
$host.UI.RawUI.BackgroundColor = $previousBackgroundColor
}
Function InstallTitusProgs {
Write-Output "Installing Chocolatey"
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install chocolatey-core.extension -y
Write-Output "Running O&O Shutup with Recommended Settings"
Import-Module BitsTransfer
Start-BitsTransfer -Source "https://raw.githubusercontent.com/DaddyMadu/Windows10GamingFocus/master/ooshutup10.cfg" -Destination ooshutup10.cfg
Start-BitsTransfer -Source "https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe" -Destination OOSU10.exe
./OOSU10.exe ooshutup10.cfg /quiet
Start-Sleep -Second 10
remove-item ooshutup10.cfg -force -Recurse -ErrorAction SilentlyContinue
remove-item OOSU10.exe -force -Recurse -ErrorAction SilentlyContinue
}
# Install the latest Microsoft Visual C++ 2010-2019 Redistributable Packages and Silverlight
Function InstallMVC {
choco install -y vcredist2010 | Out-Null
}
Function Install7Zip {
Choco Install 7zip -y
}
Function InstallChocoUpdates {
Clear-Host
choco upgrade all -y
}
#Apply PC Optimizations
Function ApplyPCOptimizations {
Write-Output "Applying PC Optimizations..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" -Name "SystemResponsiveness" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" -Name "NetworkThrottlingIndex" -Type DWord -Value 10
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" -Name "AlwaysOn" -Type DWord -Value 1
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" -Name "LazyMode" -Type DWord -Value 1
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" -Name "LazyModeTimeout" -Type DWord -Value 25000
}
#Enable or Disable and remove xbox related apps
Function askXBOX {
do
{
Clear-Host
Write-Host "================ Do You Want To Disable XBOX features and all related APPS? ================"
Write-ColorOutput "WARNING: REMOVING XBOX APPS will make Win+G do nothing!" Red
Write-Host "Y: Press 'Y' to Disable XBOX features."
Write-Host "N: Press 'N' to Enable XBOX features."
Write-Host "Q: Press 'Q' to Skip this."
$selection = Read-Host "Please make a selection"
switch ($selection)
{
'y' {
$errpref = $ErrorActionPreference #save actual preference
$ErrorActionPreference = "silentlycontinue"
Write-Output "Disabling Xbox features..."
Get-AppxPackage "Microsoft.XboxApp" | Remove-AppxPackage
Get-AppxPackage "Microsoft.XboxIdentityProvider" | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage "Microsoft.XboxSpeechToTextOverlay" | Remove-AppxPackage
Get-AppxPackage "Microsoft.XboxGameOverlay" | Remove-AppxPackage
Get-AppxPackage "Microsoft.Xbox.TCUI" | Remove-AppxPackage
Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_Enabled" -Type DWord -Value 0
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" -Name "AllowGameDVR" -Type DWord -Value 0
$ErrorActionPreference = $errpref #restore previous preference
Clear-Host
}
'n' {
$errpref = $ErrorActionPreference #save actual preference
$ErrorActionPreference = "silentlycontinue"
Write-Output "Enabling Xbox features..."
Get-AppxPackage -AllUsers "Microsoft.XboxApp" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "Microsoft.XboxIdentityProvider" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "Microsoft.XboxSpeechToTextOverlay" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "Microsoft.XboxGameOverlay" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "Microsoft.Xbox.TCUI" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_Enabled" -Type DWord -Value 1
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" -Name "AllowGameDVR" -ErrorAction SilentlyContinue
$ErrorActionPreference = $errpref #restore previous preference
Clear-Host
}
'q' { }
}
}
until ($selection -match "y" -or $selection -match "n" -or $selection -match "q")
}
#Enable Or Disable MSI Mode For Supported Cards, WARNING ENABLING MSI MODE MIGHT CRUSH YOUR SYSTEM! IF IT HAPPENS PLEASE RESTORE LAST WORKING SYSTEM RESTORE POINT AND DON'T ENABLE MSI MODE ON THIS SYSTEM AGAIN!
Function MSIMode {
$errpref = $ErrorActionPreference #save actual preference
$ErrorActionPreference = "silentlycontinue"
$GPUIDS = @(
(wmic path win32_VideoController get PNPDeviceID | Select-Object -Skip 2 | Format-List | Out-String).Trim()
)
foreach ($GPUID in $GPUIDS) {
$CheckDeviceDes = (Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$GPUID").DeviceDesc
} if(($CheckDeviceDes -like "*GTX*") -or ($CheckDeviceDes -like "*RTX*") -or ($CheckDeviceDes -like "*AMD*")) {
'GTX/RTX/AMD Compatible Card Found! Enabling MSI Mode...'
New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$GPUID\Device Parameters\Interrupt Management\MessageSignaledInterruptProperties\" -Force | Out-Null
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$GPUID\Device Parameters\Interrupt Management\MessageSignaledInterruptProperties\" -Name "MSISupported" -Type DWord -Value 1
} else {
'No GTX/RTX/AMD Compatible Card Found! Skiping...'
}
$ErrorActionPreference = $errpref #restore previous preference
}
##########
# Privacy Tweaks
##########
# Disable Telemetry
# Note: This tweak may cause Enterprise edition to stop receiving Windows updates.
# Windows Update control panel will then show message "Your device is at risk because it's out of date and missing important security and quality updates. Let's get you back on track so Windows can run more securely. Select this button to get going".
# In such case, enable telemetry, run Windows update and then disable telemetry again. See also https://github.com/Disassembler0/Win10-Initial-Setup-Script/issues/57
Function DisableTelemetry {
Write-Output "Disabling Telemetry..."
$errpref = $ErrorActionPreference #save actual preference
$ErrorActionPreference = "silentlycontinue"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
Disable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\ProgramDataUpdater" | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\Autochk\Proxy" | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\Consolidator" | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" | Out-Null
$ErrorActionPreference = $errpref #restore previous preference
}
# Enable Telemetry
Function EnableTelemetry {
Write-Output "Enabling Telemetry..."
$errpref = $ErrorActionPreference #save actual preference
$ErrorActionPreference = "silentlycontinue"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 3
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 3
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -ErrorAction SilentlyContinue
Enable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" | Out-Null
Enable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\ProgramDataUpdater" | Out-Null
Enable-ScheduledTask -TaskName "Microsoft\Windows\Autochk\Proxy" | Out-Null
Enable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\Consolidator" | Out-Null
Enable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" | Out-Null
Enable-ScheduledTask -TaskName "Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" | Out-Null
$ErrorActionPreference = $errpref #restore previous preference
}
# Disable Wi-Fi Sense
Function DisableWiFiSense {
Write-Output "Disabling Wi-Fi Sense..."
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 0
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config" -Name "AutoConnectAllowedOEM" -Type Dword -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config" -Name "WiFISenseAllowed" -Type Dword -Value 0
}
# Enable Wi-Fi Sense
Function EnableWiFiSense {
Write-Output "Enabling Wi-Fi Sense..."
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 1
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 1
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config" -Name "AutoConnectAllowedOEM" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config" -Name "WiFISenseAllowed" -ErrorAction SilentlyContinue
}
# Disable SmartScreen Filter
Function DisableSmartScreen {
Write-Output "Disabling SmartScreen Filter..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "EnableSmartScreen" -Type DWord -Value 0
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter" -Name "EnabledV9" -Type DWord -Value 0
}
# Enable SmartScreen Filter
Function EnableSmartScreen {
Write-Output "Enabling SmartScreen Filter..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "EnableSmartScreen" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter" -Name "EnabledV9" -ErrorAction SilentlyContinue
}
# Disable Web Search in Start Menu
Function DisableWebSearch {
Write-Output "Disabling Bing Search in Start Menu..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "CortanaConsent" -Type DWord -Value 0
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "DisableWebSearch" -Type DWord -Value 1
}
# Enable Web Search in Start Menu
Function EnableWebSearch {
Write-Output "Enabling Bing Search in Start Menu..."
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "CortanaConsent" -Type DWord -Value 1
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "DisableWebSearch" -ErrorAction SilentlyContinue
}
# Disable Application suggestions and automatic installation
Function DisableAppSuggestions {
Write-Output "Disabling Application suggestions..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "ContentDeliveryAllowed" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "OemPreInstalledAppsEnabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEnabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEverEnabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SilentInstalledAppsEnabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338387Enabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338388Enabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338389Enabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-353698Enabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value 0
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableWindowsConsumerFeatures" -Type DWord -Value 1
}
# Enable Application suggestions and automatic installation
Function EnableAppSuggestions {
Write-Output "Enabling Application suggestions..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "ContentDeliveryAllowed" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "OemPreInstalledAppsEnabled" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEnabled" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEverEnabled" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SilentInstalledAppsEnabled" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338388Enabled" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338389Enabled" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value 1
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338387Enabled" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-353698Enabled" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableWindowsConsumerFeatures" -ErrorAction SilentlyContinue
}
# Disable Activity History feed in Task View - Note: The checkbox "Let Windows collect my activities from this PC" remains checked even when the function is disabled
Function DisableActivityHistory {
Write-Output "Disabling Activity History..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "EnableActivityFeed" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "PublishUserActivities" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "UploadUserActivities" -Type DWord -Value 0
}
# Enable Activity History feed in Task View
Function EnableActivityHistory {
Write-Output "Enabling Activity History..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "EnableActivityFeed" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "PublishUserActivities" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "UploadUserActivities" -ErrorAction SilentlyContinue
}
# Disable Background application access - ie. if apps can download or update when they aren't used - Cortana is excluded as its inclusion breaks start menu search
Function DisableBackgroundApps {
Write-Output "Disabling Background application access..."
Get-ChildItem -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" -Exclude "Microsoft.Windows.Cortana*" | ForEach-Object {
Set-ItemProperty -Path $_.PsPath -Name "Disabled" -Type DWord -Value 1
Set-ItemProperty -Path $_.PsPath -Name "DisabledByUser" -Type DWord -Value 1
}
}
# Enable Background application access
Function EnableBackgroundApps {
Write-Output "Enabling Background application access..."
Get-ChildItem -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" | ForEach-Object {
Remove-ItemProperty -Path $_.PsPath -Name "Disabled" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $_.PsPath -Name "DisabledByUser" -ErrorAction SilentlyContinue
}
}
# Disable Location Tracking
Function DisableLocationTracking {
Write-Output "Disabling Location Tracking..."
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Name "Value" -Type String -Value "Deny"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 0
New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" -Force | Out-Null
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 0
}
# Enable Location Tracking
Function EnableLocationTracking {
Write-Output "Enabling Location Tracking..."
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Name "Value" -Type String -Value "Allow"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 1
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 1
}
# Disable automatic Maps updates
Function DisableMapUpdates {
Write-Output "Disabling automatic Maps updates..."
Set-ItemProperty -Path "HKLM:\SYSTEM\Maps" -Name "AutoUpdateEnabled" -Type DWord -Value 0
}
# Enable automatic Maps updates
Function EnableMapUpdates {
Write-Output "Enable automatic Maps updates..."
Remove-ItemProperty -Path "HKLM:\SYSTEM\Maps" -Name "AutoUpdateEnabled" -ErrorAction SilentlyContinue
}
# Disable Feedback
Function DisableFeedback {
Write-Output "Disabling Feedback..."
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules")) {
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Force | Out-Null
}
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "DoNotShowFeedbackNotifications" -Type DWord -Value 1
Disable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClient" -ErrorAction SilentlyContinue | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload" -ErrorAction SilentlyContinue | Out-Null
}
# Enable Feedback
Function EnableFeedback {
Write-Output "Enabling Feedback..."
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "DoNotShowFeedbackNotifications" -ErrorAction SilentlyContinue
Enable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClient" -ErrorAction SilentlyContinue | Out-Null
Enable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload" -ErrorAction SilentlyContinue | Out-Null
}
# Disable Tailored Experiences
Function DisableTailoredExperiences {
Write-Output "Disabling Tailored Experiences..."
If (!(Test-Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) {
New-Item -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Force | Out-Null
}
Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableTailoredExperiencesWithDiagnosticData" -Type DWord -Value 1
}
# Enable Tailored Experiences
Function EnableTailoredExperiences {
Write-Output "Enabling Tailored Experiences..."
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableTailoredExperiencesWithDiagnosticData" -ErrorAction SilentlyContinue
}
# Disable Advertising ID
Function DisableAdvertisingID {
Write-Output "Disabling Advertising ID..."
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" -Name "DisabledByGroupPolicy" -Type DWord -Value 1
}
# Enable Advertising ID
Function EnableAdvertisingID {
Write-Output "Enabling Advertising ID..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" -Name "DisabledByGroupPolicy" -ErrorAction SilentlyContinue
}
# Disable Cortana
Function DisableCortana {
Write-Output "Disabling Cortana..."
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings")) {
New-Item -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Force | Out-Null
}
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -Type DWord -Value 0
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization")) {
New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Force | Out-Null
}
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 1
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore")) {
New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Force | Out-Null
}
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -Type DWord -Value 0
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana" -Type DWord -Value 0
}
# Enable Cortana
Function EnableCortana {
Write-Output "Enabling Cortana..."
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -ErrorAction SilentlyContinue
If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore")) {
New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Force | Out-Null
}
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 0
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana" -ErrorAction SilentlyContinue
}
# Disable Error reporting
Function DisableErrorReporting {
Write-Output "Disabling Error reporting..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name "Disabled" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name "Disabled" -Type DWord -Value 1
Disable-ScheduledTask -TaskName "Microsoft\Windows\Windows Error Reporting\QueueReporting" | Out-Null
}
# Enable Error reporting
Function EnableErrorReporting {
Write-Output "Enabling Error reporting..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name "Disabled" -ErrorAction SilentlyContinue
Enable-ScheduledTask -TaskName "Microsoft\Windows\Windows Error Reporting\QueueReporting" | Out-Null
}
# Restrict Windows Update P2P only to local network - Needed only for 1507 as local P2P is the default since 1511
Function SetP2PUpdateLocal {
Write-Output "Restricting Windows Update P2P only to local network..."
$errpref = $ErrorActionPreference #save actual preference
$ErrorActionPreference = "silentlycontinue"
If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) {
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 1 | Out-Null -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization" -Name "DODownloadMode" -Type DWord -Value 1 -Force | Out-Null
$ErrorActionPreference = $errpref #restore previous preference
}
# Unrestrict Windows Update P2P
Function SetP2PUpdateInternet {
Write-Output "Unrestricting Windows Update P2P to internet..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -ErrorAction SilentlyContinue
}
# Stop and disable Diagnostics Tracking Service
Function DisableDiagTrack {
Write-Output "Stopping and disabling Diagnostics Tracking Service..."
Stop-Service "DiagTrack" -WarningAction SilentlyContinue
Set-Service "DiagTrack" -StartupType Disabled
}
# Enable and start Diagnostics Tracking Service
Function EnableDiagTrack {
Write-Output "Enabling and starting Diagnostics Tracking Service..."
Set-Service "DiagTrack" -StartupType Automatic
Start-Service "DiagTrack" -WarningAction SilentlyContinue
}
# Stop and disable WAP Push Service
Function DisableWAPPush {
Write-Output "Stopping and disabling WAP Push Service..."
Stop-Service "dmwappushservice" -WarningAction SilentlyContinue
Set-Service "dmwappushservice" -StartupType Disabled
}
# Enable and start WAP Push Service
Function EnableWAPPush {
Write-Output "Enabling and starting WAP Push Service..."
Set-Service "dmwappushservice" -StartupType Automatic
Start-Service "dmwappushservice" -WarningAction SilentlyContinue
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\dmwappushservice" -Name "DelayedAutoStart" -Type DWord -Value 1
}
# Disable New Windows 10 21h1 News Feed
Function DisableNewsFeed {
Write-Output "Disabling Windows 10 News and Interests Feed..."
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds" -Name "EnableFeeds" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds" -Name "ShellFeedsTaskbarViewMode" -Type DWord -Value 2
}
##########
# Security Tweaks
##########
# Lower UAC level (disabling it completely would break apps)
Function SetUACLow {
Write-Output "Lowering UAC level..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "PromptOnSecureDesktop" -Type DWord -Value 0
}
# Raise UAC level
Function SetUACHigh {
Write-Output "Raising UAC level..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Type DWord -Value 5
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "PromptOnSecureDesktop" -Type DWord -Value 1
}
# Enable sharing mapped drives between users
Function EnableSharingMappedDrives {
Write-Output "Enabling sharing mapped drives between users..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableLinkedConnections" -Type DWord -Value 1
}
# Disable sharing mapped drives between users
Function DisableSharingMappedDrives {
Write-Output "Disabling sharing mapped drives between users..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableLinkedConnections" -ErrorAction SilentlyContinue
}
# Disable implicit administrative shares
Function DisableAdminShares {
Write-Output "Disabling implicit administrative shares..."
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "AutoShareWks" -Type DWord -Value 0
}
# Enable implicit administrative shares
Function EnableAdminShares {
Write-Output "Enabling implicit administrative shares..."
Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "AutoShareWks" -ErrorAction SilentlyContinue
}
# Disable obsolete SMB 1.0 protocol - Disabled by default since 1709
Function DisableSMB1 {
Write-Output "Disabling SMB 1.0 protocol..."
Set-SmbServerConfiguration -EnableSMB1Protocol $false -Force
}
# Enable obsolete SMB 1.0 protocol - Disabled by default since 1709
Function EnableSMB1 {
Write-Output "Enabling SMB 1.0 protocol..."
Set-SmbServerConfiguration -EnableSMB1Protocol $true -Force
}
# Disable SMB Server - Completely disables file and printer sharing, but leaves the system able to connect to another SMB server as a client
Function DisableSMBServer {
Write-Output "Disabling SMB Server..."
Set-SmbServerConfiguration -EnableSMB1Protocol $false -Force
Set-SmbServerConfiguration -EnableSMB2Protocol $false -Force
}
# Enable SMB Server
Function EnableSMBServer {