Added -Preset for automation (#4539)

* Update start.ps1

* Update main.ps1

* Update start.ps1

* Update start.ps1

* Update main.ps1

* Update main.ps1

* Update _index.md

* Update _index.md

* Update _index.md

* Update README.md

* Update main.ps1

* Update start.ps1

* Update main.ps1

* Update main.ps1

* Update start.ps1

* Update main.ps1

* Update main.ps1

* Update main.ps1

* Update main.ps1
This commit is contained in:
Gabi
2026-05-26 13:22:28 -07:00
committed by GitHub
parent 9b72c1e2de
commit c99114e9e1
4 changed files with 52 additions and 1 deletions
+17
View File
@@ -35,6 +35,23 @@ irm "https://christitus.com/win" | iex
irm "https://christitus.com/windev" | iex irm "https://christitus.com/windev" | iex
``` ```
### Automation
Winutil also supports predefined presets that apply common configurations automatically:
- `Standard`
- `Minimal`
- `Advanced`
Example:
```powershell
& ([ScriptBlock]::Create((irm "https://christitus.com/win"))) -Preset Standard
```
To view exactly what each preset does, see:
https://github.com/ChrisTitusTech/winutil/blob/main/config/preset.json
If you have Issues, refer to [Known Issues](https://winutil.christitus.com/knownissues/) or [Create Issue](https://github.com/ChrisTitusTech/winutil/issues) If you have Issues, refer to [Known Issues](https://winutil.christitus.com/knownissues/) or [Create Issue](https://github.com/ChrisTitusTech/winutil/issues)
## 🎓 Documentation ## 🎓 Documentation
+16 -1
View File
@@ -7,7 +7,22 @@ next: /userguide/win11creator/
Use Automation to run Winutil from an exported configuration file. Use Automation to run Winutil from an exported configuration file.
To create a config file: Winutil supports predefined presets that apply common configurations automatically:
- `Standard`
- `Minimal`
- `Advanced`
Example:
```powershell
& ([ScriptBlock]::Create((irm "https://christitus.com/win"))) -Preset Standard
```
To view exactly what each preset does, see:
https://github.com/ChrisTitusTech/winutil/blob/main/config/preset.json
To create you're own config file:
1. Open Winutil. 1. Open Winutil.
2. Click the gear icon in the top-right corner. 2. Click the gear icon in the top-right corner.
+17
View File
@@ -68,6 +68,23 @@ $sync.configs.applications.PSObject.Properties | ForEach-Object {
Set-Preferences Set-Preferences
if ($Preset) {
Show-CTTLogo
# Selects the tweaks from $Preset varible
Update-WinUtilSelections -flatJson $sync.configs.preset.$Preset
# Run tweaks that were selected by Update-WinUtilSelections
Invoke-WinUtilAutoRun
# Cleanup and exit
$sync.runspace.Dispose()
$sync.runspace.Close()
[System.GC]::Collect()
Stop-Transcript
return
}
if ($PARAM_NOUI) { if ($PARAM_NOUI) {
Show-CTTLogo Show-CTTLogo
if ($PARAM_CONFIG -and -not [string]::IsNullOrWhiteSpace($PARAM_CONFIG)) { if ($PARAM_CONFIG -and -not [string]::IsNullOrWhiteSpace($PARAM_CONFIG)) {
+2
View File
@@ -8,6 +8,8 @@
param ( param (
[string]$Config, [string]$Config,
[ValidateSet("Standard", "Minimal", "Advanced")]
[string]$Preset,
[switch]$Noui, [switch]$Noui,
[switch]$Offline [switch]$Offline
) )