32 Commits
2.20 ... 3.0

Author SHA1 Message Date
Disassembler
1e977ab95f v3.0, 2018-09-15, BYOT - Bring your own tweaks
- Split execution logic from tweak library and add support for custom tweaks
 - Check "Advanced usage" chapter in README
2018-09-15 18:37:28 +02:00
r3incarnat0r
1acc37a099 Add Explorer and Start Menu tweaks (#129)
1) EnableFldrSeparateProcess / DisableFldrSeparateProcess
2) EnableRestoreFldrWindows / DisableRestoreFldrWindows
3)  DisableSharingWizard / EnableSharingWizard
4) HideRecentlyAddedApps / ShowRecentlyAddedApps
5) HideRecentJumplists / ShowRecentJumplists
2018-09-10 15:26:29 +02:00
Disassembler
3b8fc957c1 v2.21, 2018-08-27
- Improve UninstallOneDrive in multi-user environment (thx @chiva)
 - Improve SetTaskbarCombine* on multi-monitor setups (thx @kroimon)
 - Improve DisableTelemetry to not block certain updates (thx @T4CC)
 - *BREAKING* Split DisableThumbsDB into DisableThumbnailCache and DisableThumbsDBOnNetwork (thx @r3incarnat0r)
 - Add DisableWebLangList (thx @agsimmons)
 - Add "Show/Hide item selection checkboxes" (thx @Tikus)
 - Add "Uninstall Windows Fax and Scan Services" (thx @kroimon)
 - Add sound scheme related tweaks (thx @r3incarnat0r)
 - Add "HideQuickAccess" (thx @driscollw)
 - Add "Disable NCSI active test" (thx @antipatico)
 - Add "Hide Account Protection warning"
 - Add "Disable Edge desktop shortcut creation"
 - Add more keys to DisableAppSuggestion
 - Add more checks for DisableWiFiSense
 - Update "ShowTrayIcons" to use GPO (thx @driscollw)
 - Update SetP2PUpdate* tweaks to support current builds
 - Remove more and more bloatware
 - Fix typo in Enable/DisableHibernation
 - Update and clarify bunch of comments
2018-08-27 14:48:35 +02:00
Disassembler
d19e243a05 Add more Msft + Xbox packages to uninstall 2018-08-25 08:26:03 +02:00
Disassembler
c540b0e7ed Add remark to "UninstallFaxAndScan" 2018-08-25 08:21:44 +02:00
Disassembler
191e820100 Add "Disable NCSI active test", reimplements and closes #111 2018-08-23 23:25:05 +02:00
Disassembler
66953faeb6 Disable even more suggestions 2018-08-23 18:54:28 +02:00
Disassembler
70aee80559 Update SetP2PUpdate* tweaks, closes #116 (thx @Dvorak-Stepan) 2018-08-23 17:55:06 +02:00
Disassembler
8dfe56cf2e Update "ShowTrayIcons" to use GPO, closes #114 (thx @driscollw) 2018-08-23 16:01:18 +02:00
Disassembler
4c81d1cff2 Add "HideQuickAccess", closes #113 (thx @driscollw) 2018-08-23 16:00:41 +02:00
Disassembler
9e6c3d6ed4 Remove old "Show most used apps" from DisableAppSuggestions, closes #110 2018-08-23 15:31:59 +02:00
Disassembler
33d4a18633 Remove even more bloatware, related to #101 2018-08-23 14:51:50 +02:00
r3incarnat0r
fb91d9df66 Add sound scheme related tweaks (#109)
Add sound scheme related tweaks
2018-08-23 14:45:36 +02:00
Disassembler
80e9c04861 Fix typo in Enable/DisableHibernation, closes #123 2018-07-26 12:38:31 +02:00
Disassembler
22fb376831 Add more checks for Enable/DisableWiFiSense, fixes #122 2018-07-25 22:30:33 +02:00
Disassembler
3c9d6ea092 Fix forgotten rename, closes #105 2018-05-24 08:25:56 +02:00
kroimon
ab4e763fc1 Add "Uninstall Windows Fax and Scan Services" (#103) 2018-05-23 17:46:41 +02:00
kroimon
ae9998fd4a Use absolute paths in Default.cmd file (#104) 2018-05-23 17:34:30 +02:00
Disassembler
7c869b377c Update EnableMeltdownCompatFlag note, closes #98 (thx @Zero3) 2018-05-14 20:14:36 +02:00
Tikus
7313970f86 Added option to show/hide checkboxes next to items in explorer (#97) 2018-05-14 13:50:40 +02:00
Disassembler
c5cb2556a8 Add "Disable Edge desktop shortcut creation" 2018-05-09 09:26:47 +02:00
Andrew Simmons
d354c414b6 Add DisableWebLangList, enhance DisableAppSuggestions (#90) 2018-05-09 09:12:21 +02:00
r3incarnat0r
44bb2b92dd Split DisableThumbsDB (#95), closes #85 2018-05-09 08:55:37 +02:00
Disassembler
ca8c6c6859 Add "Hide Account Protection warning" 2018-05-09 08:49:24 +02:00
Disassembler
1f1412f68d Add FAQ about GPO effects, closes #84 2018-05-05 17:06:42 +02:00
Disassembler
e3af426cb5 Update RS4 build info 2018-05-04 11:20:07 +02:00
Disassembler
fee2f345e9 Update "DisableTelemetry" to disallow build previews, closes #92 (thx @T4CC) 2018-05-04 11:15:48 +02:00
kroimon
f8727c682c Set taskbar buttons combination modes for multi-monitor setups. (#91) 2018-05-01 22:00:06 +02:00
Andrew Simmons
29a22a253c Add Lenovo AppxPackage bloatware (#89) 2018-05-01 19:54:07 +02:00
Disassembler
7e39e3966f Fix a typo in comment, closes #88 2018-04-30 11:45:09 +02:00
Disassembler
f3b74a6504 Fix newlines in the default preset and rename bat to cmd, related to #85 2018-04-26 09:46:14 +02:00
Santiago Reig
b6205f65fc Remove prompt when stopping OneDrive service (#82) 2018-04-18 12:24:07 +02:00
6 changed files with 2830 additions and 2576 deletions

View File

@@ -1,3 +0,0 @@
@ECHO OFF
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "Win10.ps1" -preset "Default.preset"

3
Default.cmd Normal file
View File

@@ -0,0 +1,3 @@
@ECHO OFF
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0Win10.ps1" -include "%~dp0Win10.psm1" -preset "%~dpn0.preset"

View File

@@ -1,137 +1,168 @@
# Default preset
RequireAdmin
DisableTelemetry
DisableWiFiSense
# DisableSmartScreen
DisableWebSearch
DisableAppSuggestions
DisableActivityHistory
DisableBackgroundApps
DisableLocationTracking
DisableMapUpdates
DisableFeedback
DisableTailoredExperiences
DisableAdvertisingID
DisableCortana
DisableErrorReporting
# SetP2PUpdateLocal
DisableDiagTrack
DisableWAPPush
# SetUACLow
# EnableSharingMappedDrives
DisableAdminShares
# DisableSMB1
# DisableSMBServer
# DisableLLMNR
SetCurrentNetworkPrivate
# SetUnknownNetworksPrivate
# DisableNetDevicesAutoInst
# EnableCtrldFolderAccess
# DisableFirewall
# DisableDefender
# DisableDefenderCloud
EnableF8BootMenu
SetDEPOptOut
# EnableCIMemoryIntegrity
DisableScriptHost
EnableDotNetStrongCrypto
# EnableMeltdownCompatFlag
# DisableUpdateMSRT
# DisableUpdateDriver
DisableUpdateRestart
# DisableHomeGroups
DisableSharedExperiences
DisableRemoteAssistance
EnableRemoteDesktop
DisableAutoplay
DisableAutorun
# EnableStorageSense
# DisableDefragmentation
# DisableSuperfetch
# DisableIndexing
# SetBIOSTimeUTC
# EnableHibernation
# DisableSleepButton
# DisableSleepTimeout
# DisableFastStartup
DisableActionCenter
DisableLockScreen
# DisableLockScreenRS1
HideNetworkFromLockScreen
HideShutdownFromLockScreen
DisableStickyKeys
ShowTaskManagerDetails
ShowFileOperationsDetails
# EnableFileDeleteConfirm
HideTaskbarSearch
HideTaskView
ShowSmallTaskbarIcons
SetTaskbarCombineWhenFull
HideTaskbarPeopleIcon
ShowTrayIcons
DisableSearchAppInStore
DisableNewAppPrompt
# SetControlPanelSmallIcons
SetVisualFXPerformance
# AddENKeyboard
# EnableNumlock
ShowKnownExtensions
ShowHiddenFiles
HideSyncNotifications
HideRecentShortcuts
SetExplorerThisPC
ShowThisPCOnDesktop
# ShowUserFolderOnDesktop
HideDesktopFromThisPC
# HideDesktopFromExplorer
HideDocumentsFromThisPC
# HideDocumentsFromExplorer
HideDownloadsFromThisPC
# HideDownloadsFromExplorer
HideMusicFromThisPC
# HideMusicFromExplorer
HidePicturesFromThisPC
# HidePicturesFromExplorer
HideVideosFromThisPC
# HideVideosFromExplorer
Hide3DObjectsFromThisPC
# Hide3DObjectsFromExplorer
# DisableThumbnails
DisableThumbsDB
DisableOneDrive
UninstallOneDrive
UninstallMsftBloat
UninstallThirdPartyBloat
# UninstallWindowsStore
DisableXboxFeatures
DisableAdobeFlash
# UninstallMediaPlayer
# UninstallInternetExplorer
# UninstallWorkFolders
# InstallLinuxSubsystem
# InstallHyperV
SetPhotoViewerAssociation
AddPhotoViewerOpenWith
# UninstallPDFPrinter
UninstallXPSPrinter
RemoveFaxPrinter
# HideServerManagerOnLogin
# DisableShutdownTracker
# DisablePasswordPolicy
# DisableCtrlAltDelLogin
# DisableIEEnhancedSecurity
# EnableAudio
# UnpinStartMenuTiles
# UnpinTaskbarIcons
WaitForKey
Restart
##########
# Win10 / WinServer2016 Initial Setup Script - Default preset
# Author: Disassembler <disassembler@dasm.cz>
# Version: v3.0, 2018-09-15
# Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
##########
### Require administrator privileges ###
RequireAdmin
### Privacy Tweaks ###
DisableTelemetry # EnableTelemetry
DisableWiFiSense # EnableWiFiSense
# DisableSmartScreen # EnableSmartScreen
DisableWebSearch # EnableWebSearch
DisableAppSuggestions # EnableAppSuggestions
DisableActivityHistory # EnableActivityHistory
DisableBackgroundApps # EnableBackgroundApps
DisableLocationTracking # EnableLocationTracking
DisableMapUpdates # EnableMapUpdates
DisableFeedback # EnableFeedback
DisableTailoredExperiences # EnableTailoredExperiences
DisableAdvertisingID # EnableAdvertisingID
DisableWebLangList # EnableWebLangList
DisableCortana # EnableCortana
DisableErrorReporting # EnableErrorReporting
# SetP2PUpdateLocal # SetP2PUpdateInternet # SetP2PUpdateDisable
DisableDiagTrack # EnableDiagTrack
DisableWAPPush # EnableWAPPush
# HideRecentJumplists # ShowRecentJumplists
### Security Tweaks ###
# SetUACLow # SetUACHigh
# EnableSharingMappedDrives # DisableSharingMappedDrives
DisableAdminShares # EnableAdminShares
# DisableSMB1 # EnableSMB1
# DisableSMBServer # EnableSMBServer
# DisableLLMNR # EnableLLMNR
# DisableNCSIProbe # EnableNCSIProbe
SetCurrentNetworkPrivate # SetCurrentNetworkPublic
# SetUnknownNetworksPrivate # SetUnknownNetworksPublic
# DisableNetDevicesAutoInst # EnableNetDevicesAutoInst
# EnableCtrldFolderAccess # DisableCtrldFolderAccess
# DisableFirewall # EnableFirewall
# DisableDefender # EnableDefender
# DisableDefenderCloud # EnableDefenderCloud
EnableF8BootMenu # DisableF8BootMenu
SetDEPOptOut # SetDEPOptIn
# EnableCIMemoryIntegrity # DisableCIMemoryIntegrity
DisableScriptHost # EnableScriptHost
EnableDotNetStrongCrypto # DisableDotNetStrongCrypto
# EnableMeltdownCompatFlag # DisableMeltdownCompatFlag
### Service Tweaks ###
# DisableUpdateMSRT # EnableUpdateMSRT
# DisableUpdateDriver # EnableUpdateDriver
DisableUpdateRestart # EnableUpdateRestart
# DisableHomeGroups # EnableHomeGroups
DisableSharedExperiences # EnableSharedExperiences
DisableRemoteAssistance # EnableRemoteAssistance
EnableRemoteDesktop # DisableRemoteDesktop
DisableAutoplay # EnableAutoplay
DisableAutorun # EnableAutorun
# EnableStorageSense # DisableStorageSense
# DisableDefragmentation # EnableDefragmentation
# DisableSuperfetch # EnableSuperfetch
# DisableIndexing # EnableIndexing
# SetBIOSTimeUTC # SetBIOSTimeLocal
# EnableHibernation # DisableHibernation
# DisableSleepButton # EnableSleepButton
# DisableSleepTimeout # EnableSleepTimeout
# DisableFastStartup # EnableFastStartup
### UI Tweaks ###
DisableActionCenter # EnableActionCenter
HideAccountProtectionWarn # ShowAccountProtectionWarn
DisableLockScreen # EnableLockScreen
# DisableLockScreenRS1 # EnableLockScreenRS1
HideNetworkFromLockScreen # ShowNetworkOnLockScreen
HideShutdownFromLockScreen # ShowShutdownOnLockScreen
DisableStickyKeys # EnableStickyKeys
ShowTaskManagerDetails # HideTaskManagerDetails
ShowFileOperationsDetails # HideFileOperationsDetails
# EnableFileDeleteConfirm # DisableFileDeleteConfirm
HideTaskbarSearch # ShowTaskbarSearchIcon # ShowTaskbarSearchBox
HideTaskView # ShowTaskView
ShowSmallTaskbarIcons # ShowLargeTaskbarIcons
SetTaskbarCombineWhenFull # SetTaskbarCombineNever # SetTaskbarCombineAlways
HideTaskbarPeopleIcon # ShowTaskbarPeopleIcon
ShowTrayIcons # HideTrayIcons
DisableSearchAppInStore # EnableSearchAppInStore
DisableNewAppPrompt # EnableNewAppPrompt
# HideRecentlyAddedApps # ShowRecentlyAddedApps
# SetControlPanelSmallIcons # SetControlPanelLargeIcons # SetControlPanelCategories
SetVisualFXPerformance # SetVisualFXAppearance
# AddENKeyboard # RemoveENKeyboard
# EnableNumlock # DisableNumlock
# SetSoundSchemeNone # SetSoundSchemeDefault
# DisableStartupSound # EnableStartupSound
# DisableChangingSoundScheme # EnableChangingSoundScheme
### Explorer UI Tweaks ###
ShowKnownExtensions # HideKnownExtensions
ShowHiddenFiles # HideHiddenFiles
# EnableFldrSeparateProcess # DisableFldrSeparateProcess
# EnableRestoreFldrWindows # DisableRestoreFldrWindows
# DisableSharingWizard # EnableSharingWizard
# HideSelectCheckboxes # ShowSelectCheckboxes
HideSyncNotifications # ShowSyncNotifications
HideRecentShortcuts # ShowRecentShortcuts
SetExplorerThisPC # SetExplorerQuickAccess
HideQuickAccess # ShowQuickAccess
ShowThisPCOnDesktop # HideThisPCFromDesktop
# ShowUserFolderOnDesktop # HideUserFolderFromDesktop
HideDesktopFromThisPC # ShowDesktopInThisPC
# HideDesktopFromExplorer # ShowDesktopInExplorer
HideDocumentsFromThisPC # ShowDocumentsInThisPC
# HideDocumentsFromExplorer # ShowDocumentsInExplorer
HideDownloadsFromThisPC # ShowDownloadsInThisPC
# HideDownloadsFromExplorer # ShowDownloadsInExplorer
HideMusicFromThisPC # ShowMusicInThisPC
# HideMusicFromExplorer # ShowMusicInExplorer
HidePicturesFromThisPC # ShowPicturesInThisPC
# HidePicturesFromExplorer # ShowPicturesInExplorer
HideVideosFromThisPC # ShowVideosInThisPC
# HideVideosFromExplorer # ShowVideosInExplorer
Hide3DObjectsFromThisPC # Show3DObjectsInThisPC
# Hide3DObjectsFromExplorer # Show3DObjectsInExplorer
# DisableThumbnails # EnableThumbnails
DisableThumbnailCache # EnableThumbnailCache
DisableThumbsDBOnNetwork # EnableThumbsDBOnNetwork
### Application Tweaks ###
DisableOneDrive # EnableOneDrive
UninstallOneDrive # InstallOneDrive
UninstallMsftBloat # InstallMsftBloat
UninstallThirdPartyBloat # InstallThirdPartyBloat
# UninstallWindowsStore # InstallWindowsStore
DisableXboxFeatures # EnableXboxFeatures
DisableAdobeFlash # EnableAdobeFlash
DisableEdgeShortcutCreation # EnableEdgeShortcutCreation
# UninstallMediaPlayer # InstallMediaPlayer
# UninstallInternetExplorer # InstallInternetExplorer
# UninstallWorkFolders # InstallWorkFolders
# InstallLinuxSubsystem # UninstallLinuxSubsystem
# InstallHyperV # UninstallHyperV
SetPhotoViewerAssociation # UnsetPhotoViewerAssociation
AddPhotoViewerOpenWith # RemovePhotoViewerOpenWith
# UninstallPDFPrinter # InstallPDFPrinter
UninstallXPSPrinter # InstallXPSPrinter
RemoveFaxPrinter # AddFaxPrinter
# UninstallFaxAndScan # InstallFaxAndScan
### Server Specific Tweaks ###
# HideServerManagerOnLogin # ShowServerManagerOnLogin
# DisableShutdownTracker # EnableShutdownTracker
# DisablePasswordPolicy # EnablePasswordPolicy
# DisableCtrlAltDelLogin # EnableCtrlAltDelLogin
# DisableIEEnhancedSecurity # EnableIEEnhancedSecurity
# EnableAudio # DisableAudio
### Unpinning ###
# UnpinStartMenuTiles
# UnpinTaskbarIcons
### Auxiliary Functions ###
WaitForKey
Restart

118
README.md
View File

@@ -3,6 +3,7 @@
- [Usage](#usage)
- [FAQ](#faq)
- [Windows builds overview](#windows-builds-overview)
- [Advanced usage](#advanced-usage)
- [Maintaining own forks](#maintaining-own-forks)
- [Contribution guidelines](#contribution-guidelines)
@@ -15,33 +16,9 @@ This is a PowerShell script for automation of routine tasks done after fresh ins
&nbsp;
## Usage
If you just want to run the script with default preset, simply right click on the *Win10.ps1* file, choose *Run with PowerShell*, and confirm execution policy change. Make sure your account is a member of *Administrators* group as the script attempts to run with elevated privileges.
If you just want to run the script with the default preset, download and unpack the [latest release](https://github.com/Disassembler0/Win10-Initial-Setup-Script/releases) and then simply double-click on the *Default.cmd* file and confirm *User Account Control* prompt. Make sure your account is a member of *Administrators* group as the script attempts to run with elevated privileges.
Alternatively copy also *Default.bat* and *Default.preset* along with the *Win10.ps1* file and then doubleclick on *Default.bat* to run it.
### Advanced usage
The script consists of separate functions, each of which contains one tweak. The functions can be grouped to *presets*. Preset is simply a list of function names which should be called. If you don't supply any specific preset, the default preset defined by `$tweaks` array in the beginning of the script will be applied. Any function which is not present or is commented in a preset will not be called, thus the corresponding tweak will not be applied.
To supply a customized preset, you can either pass the function names directly as parameters.
powershell.exe -NoProfile -ExecutionPolicy Bypass -File Win10.ps1 EnableFirewall EnableDefender
Or you can create a file where you write the function names (one function name per line, no commas, whitespaces allowed, comments on separate lines starting with `#`) and then pass the filename using *-preset* parameter.
Example of a preset file `mypreset.txt`:
# Security tweaks
EnableFirewall
EnableDefender
# UI tweaks
ShowKnownExtensions
ShowHiddenFiles
Command using the preset file above:
powershell.exe -NoProfile -ExecutionPolicy Bypass -File Win10.ps1 -preset mypreset.txt
For even more advanced usage, refer to section [Maintaining own forks](#maintaining-own-forks).
The script supports command line options and parameters which can help you customize the tweak selection or even add your own custom tweaks, however these features require some basic knowledge of command line usage and PowerShell scripting. Refer to [Advanced usage](#advanced-usage) section for more details.
&nbsp;
@@ -68,9 +45,12 @@ For even more advanced usage, refer to section [Maintaining own forks](#maintain
**Q:** Did you test the script?
**A:** Yes. I'm testing new additions on up-to-date 64bit Home and Enterprise editions in VMs. I'm also regularly using it for all my home installations after all bigger updates.
**Q**: I've run the script and it did xxx, how can I undo it?
**Q**: I've run the script and it did something I don't like, how can I undo it?
**A:** For every tweak, there is also a corresponding function which restores the default settings. The default is considered freshly installed Windows 10 or Windows Server 2016 with no adjustments made during or after the installation. Use the tweaks to create and run new preset. Alternatively, since some functions are just automation for actions which can be done using GUI, find appropriate control and modify it manually.
**Q:** I've run the script and some controls are now greyed out and display message "*Some settings are hidden or managed by your organization*", why?
**A:** To ensure that system-wide tweaks are applied smoothly and reliably, some of them make use of *Group Policy Objects* (*GPO*). The same mechanism is employed also in companies managing their computers in large scale, so the users without administrative privileges can't change the settings. If you wish to change a setting locked by GPO, apply the appropriate restore tweak and the control will become available again.
**Q:** I've run the script and it broke my computer / killed neighbor's dog / caused world war 3.
**A:** I don't care. Also, that's not a question.
@@ -100,15 +80,83 @@ For even more advanced usage, refer to section [Maintaining own forks](#maintain
| 1607 | Redstone 1 (RS1) | Anniversary Update | 14393 |
| 1703 | Redstone 2 (RS2) | Creators Update | 15063 |
| 1709 | Redstone 3 (RS3) | Fall Creators Update | 16299 |
| 1803 | Redstone 4 (RS4) | Spring Creators Update | 17133 |
| 1803 | Redstone 4 (RS4) | April 2018 Update | 17134 |
&nbsp;
## Advanced usage
powershell.exe -NoProfile -ExecutionPolicy Bypass -File Win10.ps1 [-include filename] [-preset filename] [tweakname]
-include filename load module with user-defined tweaks
-preset filename load preset with tweak names to apply
tweakname apply tweak with this particular name
### Presets
The tweak library consists of separate idempotent functions, containing one tweak each. The functions can be grouped to *presets*. Preset is simply a list of function names which should be called. Any function which is not present or is commented in a preset will not be called, thus the corresponding tweak will not be applied. In order for the script to do something, you need to supply at least one tweak library via `-include` and at least one tweak name, either via `-preset` or directly as command line argument.
To supply a customized preset, you can either pass the function names directly as arguments.
powershell.exe -NoProfile -ExecutionPolicy Bypass -File Win10.ps1 -include Win10.psm1 EnableFirewall EnableDefender
Or you can create a file where you write the function names (one function name per line, no commas or quotes, whitespaces allowed, comments starting with `#`) and then pass the filename using `-preset` parameter.
Example of a preset file `mypreset.txt`:
# Security tweaks
EnableFirewall
EnableDefender
# UI tweaks
ShowKnownExtensions
ShowHiddenFiles # Only hidden, not system
Command using the preset file above:
powershell.exe -NoProfile -ExecutionPolicy Bypass -File Win10.ps1 -include Win10.psm1 -preset mypreset.txt
### Includes
The script also supports inclusion of custom tweaks from user-supplied modules passed via `-include` parameter. The content of the user-supplied module is completely up to the user, however it is strongly recommended to have the tweaks separated in respective functions as the main tweak library has. The user-supplied scripts are loaded into the main script via `Import-Module`, so the library should ideally be a `.psm1` PowerShell module.
Example of a user-supplied tweak library `mytweaks.psm1`:
```powershell
Function MyTweak1 {
Write-Output "Running MyTweak1..."
# Do something
}
Function MyTweak2 {
Write-Output "Running MyTweak2..."
# Do something else
}
```
Command using the script above:
powershell.exe -NoProfile -ExecutionPolicy Bypass -File Win10.ps1 -include mytweaks.psm1 MyTweak1 MyTweak2
### Combination
All features described above can be combined. You can have a preset which includes both tweaks from the original script and your personal ones. Both `-include` and `-preset` options can be used more than once, so you can split your tweaks into groups and then combine them based on your current needs. The `-include` modules are always imported before the first tweak is applied, so the order of the command line parameters doesn't matter and neither does the order of the tweaks (except for `RequireAdmin`, which should always be called first and `Restart`, which should be always called last). It can happen that some tweaks are applied more than once during a singe run because you have them in multiple presets. That shouldn't cause any problems as the tweaks are idempotent.
Example of a preset file `otherpreset.txt`:
InstallLinuxSubsystem
MyTweak1
MyTweak2
WaitForKey
Command using all three examples combined:
powershell.exe -NoProfile -ExecutionPolicy Bypass -File Win10.ps1 -include Win10.psm1 -include mytweaks.psm1 -preset mypreset.txt -preset otherpreset.txt Restart
&nbsp;
## Maintaining own forks
The easiest way how to customize the script settings it is to create your own preset file. For easy start, you can base it on the *Default.bat* and *Default.preset* and maintain just that. If you choose to fork the script anyway and adjust the defaults directly in the script instead, then all you have to modify is the `$tweaks` array in the beginning of the script. You don't need to comment or remove the actual functions, because if they are not called, they are not used.
The easiest way to customize the script settings it is to create your own preset and, if needed, your own tweak scripts as described above. For easy start, you can base the modifications on the *Default.cmd* and *Default.preset* and maintain just that. If you choose to fork the script anyway, you don't need to comment or remove the actual functions in *Win10.psm1*, because if they are not called, they are not used.
If you wish to make more elaborate modifications and incorporate some personal tweaks or adjustments, the I suggest doing it in a following way:
If you wish to make more elaborate modifications of the basic script and incorporate some personal tweaks or adjustments, then I suggest doing it in a following way:
1. Fork the repository on GitHub (obviously).
2. Clone your fork on your computer.
@@ -118,14 +166,14 @@ If you wish to make more elaborate modifications and incorporate some personal t
cd Win10-Initial-Setup-Script
```
3. Add the original repository as a remote.
3. Add the original repository as a remote (*upstream*).
```
git remote add upstream https://github.com/Disassembler0/Win10-Initial-Setup-Script
```
4. Commit your modifications as you see fit.
5. Once there are new additions in the upstream commited by me, create a temporary branch, fetch the changes and reset the branch to be identical with my repository.
5. Once there are new additions in the upstream, create a temporary branch, fetch the changes and reset the branch to be identical with this repository.
```
git branch upstream
@@ -169,13 +217,13 @@ Check if there isn't already a function with similar purpose as the one you're t
Try to group functions thematically. There are already several major groups (privacy, security, services etc.), but even within these, some tweaks may be related to each other. In such case, add a new tweak below the existing one and not to the end of the whole group.
### Default preset
Always add a reference to the tweak and its revert function in the `$tweaks` array containing the default set of tweaks. Add references to both functions on the same line (mind the quotes and commas) and always comment out the revert function. Whether to comment out also the tweak in the default preset is a matter of personal preference. The rule of thumb is that if the tweak makes the system faster, smoother, more secure and less obtrusive, it should be enabled by default. Usability has preference over performance (that's why e.g. indexing is kept enabled). Also don't forget to add the function references to the *Default.preset* file.
Always add a reference to the tweak and its revert function in the *Default.preset*. Add references to both functions on the same line (mind the spaces) and always comment out the revert function. Whether to comment out also the tweak in the default preset is a matter of personal preference. The rule of thumb is that if the tweak makes the system faster, smoother, more secure and less obtrusive, it should be enabled by default. Usability has preference over performance (that's why e.g. indexing is kept enabled).
### Repeatability
Unless applied on unsupported system, all functions have to be applicable repeatedly without any errors. When you're creating a registry key, always check first if the key doesn't happen to already exist. When you're deleting registry value, always append `-ErrorAction SilentlyContinue` to prevent errors while deleting already deleted values.
### Input / output hiding
Suppress all output generated by commands and cmdlets using `| Out-Null` or `-ErrorAction SilentlyContinue` where applicable. Whenever an input is needed, use appropriate parameters to suppress the prompt and programmatically provide values for the command to run (e.g. using `-Confirm:$false`). The only acceptable output is from the `Write-Output` cmdlets in the beginning of each function and from non-suppressible cmdlets like `Remove-AppxPackage`.
Suppress all output generated by commands and cmdlets using `| Out-Null` or `-ErrorAction SilentlyContinue` where applicable. Whenever an input is needed, use appropriate arguments to suppress the prompt and programmatically provide values for the command to run (e.g. using `-Confirm:$false`). The only acceptable output is from the `Write-Output` cmdlets in the beginning of each function and from non-suppressible cmdlets like `Remove-AppxPackage`.
### Registry
Create the registry keys only if they don't exist on fresh installation if Windows 10 or Windows Server 2016. When deleting registry, delete only registry values, not the whole keys. When you're setting registry values, always use `Set-ItemProperty` instead of `New-ItemProperty`. When you're removing registry values, choose either `Set-ItemProperty` or `Remove-ItemProperty` to reinstate the same situation as it was on the clean installation. Again, if you don't know what the original state was, let me know in PR description and I will fill in the gaps. When you need to use `HKEY_USERS` registry hive, always add following snippet before the registry modification to ensure portability.
@@ -187,7 +235,7 @@ If (!(Test-Path "HKU:")) {
```
### Force usage
Star Wars jokes aside, don't use `-Force` parameter unless absolutely necessary. The only permitted case is when you're creating a new registry key (not a value) and you need to ensure that all parent keys will be created as well. In such case always check first if the key doesn't already exist, otherwise you will delete all its existing values.
Star Wars jokes aside, don't use `-Force` option unless absolutely necessary. The only permitted case is when you're creating a new registry key (not a value) and you need to ensure that all parent keys will be created as well. In such case always check first if the key doesn't already exist, otherwise you will delete all its existing values.
### Comments
Always add a simple comment above the function briefly describing what the function does, especially if it has an ambiguous name or if there is some logic hidden under the hood. If you know that the tweak doesn't work on some editions of Windows 10 or on Windows Server, state it in the comment too. Add a `Write-Output` cmdlet with the short description of action also to the first line of the function body, so the user can see what is being executed and which function is the problematic one whenever an error occurs. The comment is written in present simple tense, the `Write-Output` in present continuous with ellipsis (resp. three dots) at the end.

2426
Win10.ps1

File diff suppressed because it is too large Load Diff

2551
Win10.psm1 Normal file

File diff suppressed because it is too large Load Diff