Skip to content
This repository was archived by the owner on Aug 21, 2021. It is now read-only.

Commit 935eb6d

Browse files
committed
update 1.0.0-beta.1
1 parent c3d95c1 commit 935eb6d

File tree

4 files changed

+144
-11
lines changed

4 files changed

+144
-11
lines changed

README.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,48 @@
11
# WindowsToolbox-Auto
2-
WindowsToolbox But Automatic With A Config. WIP DO NOT USE YET NOT DONE
2+
WindowsToolbox but automatic, intended for post-install and first boot setup.
3+
4+
5+
## DISCLAMER:
6+
7+
This software is in beta. **All scripts are provided as-is and you use them at your own risk. WinTweakers are NOT responsible for ANY damage caused by these scripts. These scripts is only ment for system administrators who know what they're doing. Please read README before proceeding**
8+
9+
# Usage
10+
11+
**You have to at least edit main.ps1 before using since all functions are enabled by default**
12+
13+
14+
Comment out the function that you don't want to run. E.g: DisableWindowsDefender -> #DisableWindowsDefender
15+
16+
For post-install after first boot purposes: extract this repo to your install image under "%WINDIR%\Setup\Scripts"
17+
18+
For more infomation about Windows Setup, go to [Microsoft's documentation](https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/add-a-custom-script-to-windows-setup)
19+
20+
## Liability
21+
22+
**All scripts are provided as-is and you use them at your own risk.**
23+
24+
## Contributing
25+
26+
Contributions are welcome, just make a pull request and we'll accept it if it's actually helpful.
27+
28+
## License
29+
30+
Copyright (c) 2021 WinTweakers
31+
32+
Permission is hereby granted, free of charge, to any person obtaining a copy
33+
of this software and associated documentation files (the "Software"), to deal
34+
in the Software without restriction, including without limitation the rights
35+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
36+
copies of the Software, and to permit persons to whom the Software is
37+
furnished to do so, subject to the following conditions:
38+
39+
The above copyright notice and this permission notice shall be included in all
40+
copies or substantial portions of the Software.
41+
42+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
43+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
44+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
45+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
46+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
47+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
48+
SOFTWARE.

SetupComplete.cmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
powershell "& "".\\main.ps1"""
2+
exit

library/functions.psm1 renamed to functions.psm1

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,23 @@
163163
}
164164
}
165165

166-
function InstallChoco {
167-
$testchoco = powershell choco -v
168-
if(-not($testchoco)){
169-
Write-Output "Seems Chocolatey is not installed, installing now"
170-
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
171-
choco feature enable -n allowGlobalConfirmation
166+
function InstallWinGet {
167+
try {
168+
# Check if winget is already installed
169+
$er = (invoke-expression "winget -v") 2>&1
170+
if ($lastexitcode) { throw $er }
171+
Write-Host "winget is already installed."
172172
}
173-
else{
174-
choco feature enable -n allowGlobalConfirmation
175-
Write-Output "Chocolatey Version $testchoco is already installed"
173+
catch {
174+
# If winget is not installed. Install it from the Github release
175+
Write-Host "winget is not found, installing it right now."
176+
177+
$download = "https://github.com/microsoft/winget-cli/releases/download/latest/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"
178+
Write-Host "Dowloading latest release"
179+
Invoke-WebRequest -Uri $download -OutFile $PSScriptRoot\winget-latest.appxbundle
180+
181+
Write-Host "Installing the package"
182+
Add-AppxPackage -Path $PSScriptRoot\winget-latest.appxbundle
176183
}
177184
}
178185

@@ -952,7 +959,7 @@
952959
New-ItemProperty -LiteralPath 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize' -Name 'AppsUseLightTheme' -Value 0 -PropertyType DWord -Force -ea SilentlyContinue;
953960
}
954961

955-
function RAM {
962+
function LowerRAMUsage {
956963
if((Test-Path -LiteralPath "HKLM:\SYSTEM\CurrentControlSet\Control") -ne $true) { New-Item "HKLM:\SYSTEM\CurrentControlSet\Control" -force -ea SilentlyContinue };
957964
if((Test-Path -LiteralPath "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile") -ne $true) { New-Item "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" -force -ea SilentlyContinue };
958965
if((Test-Path -LiteralPath "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks") -ne $true) { New-Item "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks" -force -ea SilentlyContinue };
@@ -1068,4 +1075,19 @@
10681075
function DisableAeroShake {
10691076
Write-Output "Disabling Aero Shake..."
10701077
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "DisallowShaking" -Type DWord -Value 1
1078+
}
1079+
1080+
#Undo functions
1081+
function EnableTelemetry {
1082+
Write-Output "(Re)Enabling Telemetry..."
1083+
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 3
1084+
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 3
1085+
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -ErrorAction SilentlyContinue
1086+
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds" -Name "AllowBuildPreview" -ErrorAction SilentlyContinue
1087+
Enable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" | Out-Null
1088+
Enable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\ProgramDataUpdater" | Out-Null
1089+
Enable-ScheduledTask -TaskName "Microsoft\Windows\Autochk\Proxy" | Out-Null
1090+
Enable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\Consolidator" | Out-Null
1091+
Enable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" | Out-Null
1092+
Enable-ScheduledTask -TaskName "Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" | Out-Null
10711093
}

main.ps1

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
Set-ExecutionPolicy Unrestricted -Scope CurrentUser
2+
ls -Recurse *.ps*1 | Unblock-File
3+
#Self-elevate the script if required
4+
if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
5+
if ([int](Get-CimInstance -Class Win32_OperatingSystem | Select-Object -ExpandProperty BuildNumber) -ge 6000) {
6+
$CommandLine = "-File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments
7+
Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CommandLine
8+
Exit
9+
}
10+
}
11+
12+
Import-Module -DisableNameChecking $PSScriptRoot\functions.psm1
13+
14+
<# Disclaimer: This script is only ment for system administrators who know what they're doing. Please read README before proceeding
15+
For a more user-friendly approach, use WindowsToolbox.
16+
Info about tweaks is in README.md #>
17+
18+
<# Usage: Comment out any function that you don't want to run, all functions will run by default
19+
e.g: DisableWindowsDefender -> #DisableWindowsDefender #>
20+
21+
#Debloat functions:
22+
23+
DisableWindowsDefender #Disable Windows Defender (NOT RECOMMENDED)
24+
RemoveDefaultApps #Remove default UWP bloatware
25+
RemoveOneDrive #Remove OneDrive
26+
OptimizeUpdates #Optimize Windows Updates
27+
DisableServices #Disable unused / rarely used services
28+
DisableCortana #Disable Cortana
29+
30+
#Privacy settings:
31+
32+
Disable-Telemetry #Disable telemetry
33+
PrivacyFixSettings #Fix privacy settings
34+
DisableAppSuggestions #Disable app suggestions
35+
DisableTailoredExperiences #Disable Tailored Experiences
36+
DisableAdvertisingID #Disable AdvertistingID
37+
38+
#Tweaks
39+
40+
#System tweaks:
41+
42+
LowerRAMUsage #Lowers RAM usage by a lot
43+
EnablePhotoViewer #Enable Windows Photo Viewer
44+
DisablePrefetchPrelaunch #Disable Prefetch Prelaunch
45+
DisableEdgePrelaunch #Disable Edge Prelaunch
46+
UseUTC #Use UTC time (useful for syncing time between Windows and other OS)
47+
DisableShellExperienceHost #Disable ShellExperienceHost (breaks Explorer, Start menu, etc)
48+
GodMode #Create a God Mode shortcut on your desktop
49+
ImproveSSD #Improve SSD lifespan
50+
DisableSearchUI #Disable SearchUI
51+
52+
#UI tweaks:
53+
RemoveThisPClutter #Remove user folders under ThisPC
54+
DarkMode #Enable dark mode
55+
DisableAeroShake #Disable Aero Shake
56+
TBSingleClick #Switch windows with a single click on the taskbar
57+
58+
#Undo (tbh dunno why would you run this at first boot but here they are)
59+
EnableTelemetry #(Re)enable telemetry
60+
61+
#Other
62+
Restart #Restart the computer
63+
Info #Show info

0 commit comments

Comments
 (0)