This PowerShell script is for initial setup after fresh installation of Windows 10 and partially Windows Server 2016/2019. The script is a set of tweaks for fine-tuning the OS and automating the routine tasks.
- Turn off diagnostics tracking services;
- Turn off diagnostics tracking scheduled tasks;
- Interactive prompts
- Uninstall all UWP apps from all accounts with exception apps list;
- Turn off Windows features;
- Create scheduled task with the disk cleanup tool in Task Scheduler;
- Create task to clean out the "$env:SystemRoot\SoftwareDistribution\Download" folder in Task Scheduler;
- Create scheduled task with the $env:TEMP folder cleanup in Task Scheduler;
- Add folder to exclude from Windows Defender Antivirus scan;
- Turn off per-user services;
- Create old style shortcut for "Devices and Printers";
- Import Start menu layout from pre-saved reg file;
- Download pre-saved Startmenu.reg
- Screenshot
- Unpin all Start menu tiles;
- Set location of the "Desktop", "Documents" "Downloads" "Music", "Pictures", and "Videos";
- Refresh desktop icons, environment variables and taskbar without restarting File Explorer;
- Many more File Explorer and context menu "deep" tweaks.
To run the script:
- Download up-to-date version;
- Change encoding to "UTF-8 with BOM" and run it through powershell.exe.
or
- Copy the script code and paste it into PowerShell ISE.
NB
- PowerShell and PowerShell ISE must be run with elevated privileges;
- Set PowerShell execution policy
Set-ExecutionPolicy Unrestricted -Force
to be able to run .ps1 files.- Read more about execution policy
Version | Code name | Marketing name | Build |
---|---|---|---|
1903 | 19H1 | May 2019 Update | 18362 |
Read the code you run carefully. Some functions are presented as an example only. You must be aware of the meaning of the functions in the code. If you're not sure what the script does, do not run it.
The script was written for PowerShell 5.1 and for the current up-to-date version of Windows 10 Pro x64. Some of functions can be run also on LTSB/LTSC and on older versions of Windows and PowerShell (also on 32bit systems).
Collection of useful scripts