Compare commits

...
38 Commits
Author SHA1 Message Date
Paweł GwozdowskiandGitHub 157a66b14d Update Invoke-WPFUIElements.ps1 (#4824) 2026-07-13 13:20:53 -05:00
9791386f53 fix: resolve silent failures in AppX removal and PS7 DISM bugs (#4822)
* fix: resolve silent failures in AppX removal and PS7 DISM bugs

- Fixed a bug where Remove-AppxPackage failed silently in PowerShell 7 due to pipeline binding issues. We now explicitly loop through Get-AppxPackage results and pass PackageFullName directly.
- Added wildcard matching to Get-AppxPackage and Get-AppxProvisionedPackage to reliably locate packages regardless of short name vs family name variations.
- Offloaded Get-AppxProvisionedPackage and Remove-AppxProvisionedPackage execution to Windows PowerShell 5.1 (powershell.exe) to bypass PowerShell 7 DISM COM exceptions ("Class not registered") and performance hangs.
- Deduplicated AppX removal logic by calling Remove-WinUtilAPPX directly from Invoke-WPFAppxRemoval instead of copying the implementation.

* refactor(Remove-WinUtilAPPX): use script block to improve readability

* feat: enhance AppX removal process and add provisioned package removal function

* fix(tests): update AppX removal tests

This also adds tests for the new Remove-WinUtilProvisionedAPPX functionality

* Move AppX removal under Tweaks

* Address AppX removal review feedback

* Complete AppX removal error handling

* Prevent AppX cleanup confirmation prompts

---------

Co-authored-by: Chris Titus <contact@christitus.com>
2026-07-13 13:16:35 -05:00
Chris TitusandGitHub c8e756dc11 chore: Update generated dev docs (#4838) 2026-07-13 11:40:20 -05:00
Sean (ANGRYxScotsman)andGitHub 9e21c8f4a7 Updated ConsumerFeatures description and small dev doc edit (#4817)
* Update tweaks.json

* Update _index.md

* Update _index.md
2026-07-13 11:39:49 -05:00
Chris TitusandGitHub 8cd8679512 chore: Update generated dev docs (#4837) 2026-07-13 11:37:52 -05:00
ac11c73b64 feat(legacy-panels): add Firewall, Security, Programs, and Mouse to L… (#4809)
* feat(legacy-panels): add Firewall, Security, Programs, and Mouse to Legacy Windows Panels

- Added `firewall.cpl`, `wscui.cpl`, `appwiz.cpl`, and `main.cpl` to `config/feature.json`

* chore(legacy-panels): alphabetize panel entries

---------

Co-authored-by: Chris Titus <contact@christitus.com>
2026-07-13 11:37:22 -05:00
KarimandGitHub 9d67514bf9 feat(apps): add gsudo (#4810)
- Added gsudo to the Pro Tools category to provide a native sudo equivalent for Windows terminals.
2026-07-13 10:26:44 -05:00
Chris TitusandGitHub fea9f4e869 chore: Update generated dev docs (#4836) 2026-07-13 10:26:33 -05:00
1aa0dd90ef prevent-automatic-download-of-applications-associated-with-device-metadata (#4827)
* add tweak

* add devdocs

* add devdocs

---------

Co-authored-by: matthewkasiski <matt@matthewkasiski.me>
2026-07-13 10:25:58 -05:00
Yayo RazoandGitHub 90a19685f5 fix(install): use correctly-scoped $app instead of undefined $Apps in app entry rendering (#4834) 2026-07-13 04:23:24 -05:00
007995c112 Improve install app card UI (#4771)
Co-authored-by: Chris Titus <contact@christitus.com>
2026-07-11 11:21:59 -05:00
Chris Titus 0dcd361c51 Remove slash commands for contributors 2026-07-09 14:25:50 -05:00
eduardodepaivaandGitHub aeaef46e30 Fix names in applications.json. (#4819) 2026-07-08 10:25:15 -05:00
Ivan LepekhaandGitHub e0dfeb4f4d Remove Lightshot entry from applications.json (#4808)
Removed Lightshot application entry from applications.json
2026-07-04 09:52:55 -05:00
Chris Titus 1c7ee06bbe chore: skip automated updates in changelog 2026-07-04 00:58:24 -05:00
ed6de94c46 Update sponsors in README (#4544)
Co-authored-by: ChrisTitusTech <7896101+ChrisTitusTech@users.noreply.github.com>
2026-07-04 00:52:10 -05:00
Chris TitusandGitHub 640b02868a fix(iso): resolve windows update re-enabling failures on first boot (#4807)
* fix iso update service reenable

* test allow font scale sync state
2026-07-04 00:50:45 -05:00
29b269201d Add font scaling keyboard and mouse shortcuts (#4781)
* Add font scaling shortcuts

* Fix font scaling shortcut modifiers

---------

Co-authored-by: Chris Titus <contact@christitus.com>
2026-07-04 00:32:39 -05:00
GabiandGitHub 9fed8d1c4c Reapply font scaling after theme change (#4782) 2026-07-04 00:29:22 -05:00
Chris TitusandGitHub 4ae3549b8a chore: Update generated dev docs (#4806) 2026-07-04 00:21:28 -05:00
Ivan LepekhaandGitHub e72ac75d13 feat(github): Add version context for issues (#4803)
* Create app suggestion discussion template

Add a discussion template for app suggestions with rules and input fields.

* Add application suggestion link to issue template

Added a link for suggesting applications to the issue template.

* Update app suggestion discussion template

* Add checkbox for WinGet application presence check

* Changed name of file, didn't change name of link XD

* Add WinUtil version input to bug report template

Added input field for WinUtil version in bug report template.

* whoops :^)

* Someone forgot that label is single value parameter

* GH Wiki is a liar

* GH Docs are looking awful
2026-07-04 00:21:26 -05:00
LKmXrandGitHub 9846dd7b49 Fix Multiplane Overlay toggle (#4768)
* Fix MPO values

DisableOverlays should be 0

* Update tweaks.json
2026-07-04 00:20:48 -05:00
eduardodepaivaandGitHub 466d32e690 Add MiniTool Partition Wizard and fix Everything sorting. (#4766) 2026-07-04 00:10:40 -05:00
Chris TitusandGitHub dce1536be0 chore: Update generated dev docs (#4805) 2026-07-04 00:06:25 -05:00
894d62ca68 Added WPFToggleWindowSnapping to tweaks.json (#4748)
* Added WPFToggleWindowSnapping to tweaks.json

* Update tweaks.json

* Update tweaks.json

* Update tweaks.json

* Update tweaks.json

* Update tweaks.json

* Add Window Snapping tweak docs

---------

Co-authored-by: Chris Titus <contact@christitus.com>
2026-07-04 00:05:56 -05:00
27e590577b fix: make tweak/feature link (?) follow font scaling (#4700)
* Update Invoke-WPFUIElements.ps1

* Update Invoke-WPFUIElements.ps1

* Update Invoke-WPFUIElements.ps1

Update Invoke-WPFUIElements.ps1

* Fix tweak link margin scaling

---------

Co-authored-by: Chris Titus <contact@christitus.com>
2026-07-03 23:51:11 -05:00
Chris TitusandGitHub 8147903ff2 chore: Update generated dev docs (#4801) 2026-07-02 15:26:16 -05:00
GabiandGitHub 7a72c73906 Talk about "PowerShell 7 from the Microsoft Store" inside of KnownIssues.md (#4758)
* Talk about "PowerShell 7 from the Microsoft Store" inside of KnownIssues.md

* Update Invoke-WinUtilInstallPSProfile.ps1

* Update KnownIssues.md

* Update KnownIssues.md

* Update KnownIssues.md
2026-07-02 15:25:08 -05:00
Chris TitusandGitHub 32891ada55 Fix DHCP DNS reset handling (#4800) 2026-07-02 15:24:14 -05:00
Chris TitusandGitHub e2d6f8534e chore: Update generated dev docs (#4798) 2026-07-02 13:29:34 -05:00
299b68e82d Added winget uninstall of Copilot. Line 968 Remove-AppxPackage is not working when Copilot is installed back after Windows Updates and the only option that works is using winget (#4797)
Co-authored-by: gepardjaro <192244662+gepardjaro@users.noreply.github.com>
2026-07-02 13:28:57 -05:00
de6652adc0 Remove local file preference storage and cleanup Invoke-WinutilThemeChange (#4617)
* Remove local file preference storage

* Update main.ps1

* Update main.ps1

* Update Set-Preferences.ps1

* Update main.ps1

* Update Set-Preferences.ps1

* Update main.ps1

* Delete functions/private/Set-Preferences.ps1

* simplify Invoke-WinutilThemeChange.ps1

* fix foss highlight in Invoke-WinutilThemeChange.ps1

* Update Invoke-WinutilThemeChange.ps1

* Update Invoke-WinutilThemeChange.ps1

* Update main.ps1

---------

Co-authored-by: Chris Titus <contact@christitus.com>
2026-07-02 13:04:50 -05:00
727ba52a4d Deleted Test-WinUtilPackageManager.ps1 + custom winget and choco installs + remove winget/choco enums and exeptions (#4606)
* Update Invoke-WPFGetInstalled.ps1

* Update Install-WinUtilWinget.ps1

* Update Install-WinUtilChoco.ps1

* Update Install-WinUtilChoco.ps1

* Update Install-WinUtilWinget.ps1

* Delete functions/private/Test-WinUtilPackageManager.ps1

* Update Install-WinUtilChoco.ps1

* Update Install-WinUtilWinget.ps1

* Update Install-WinUtilChoco.ps1

* Update Invoke-WPFGetInstalled.ps1

* Update Invoke-WPFGetInstalled.ps1

* Update Install-WinUtilChoco.ps1

* Update Install-WinUtilWinget.ps1

* Update Install-WinUtilWinget.ps1

* Update Install-WinUtilChoco.ps1

* Update Install-WinUtilWinget.ps1

* Update Install-WinUtilChoco.ps1

* Update Install-WinUtilWinget.ps1

* Update Install-WinUtilChoco.ps1

* Update Install-WinUtilChoco.ps1

* Update Install-WinUtilChoco.ps1

* Update Install-WinUtilChoco.ps1

* Update Install-WinUtilWinget.ps1

* Fixed lastrun.json

* refactor: remove PackageManagers enum and unused custom exception classes

* Update Invoke-WPFUIElements.ps1

* Update Get-WinUtilSelectedPackages.ps1

* Update Set-Preferences.ps1

* Update main.ps1

* Complete package manager enum removal

Use string package-manager preferences throughout the remaining helpers and focused tests. Restore the existing Winget install flow and package-manager probe helper so PR 4606 keeps the current WinGet repair method.

* Fix string keyed package split

---------

Co-authored-by: Chris Titus <contact@christitus.com>
2026-07-02 12:50:57 -05:00
d45c62e470 Cleanup start.ps1 (#4587)
* Update start.ps1

* Update start.ps1

* Update start.ps1

* Update start.ps1

* Update start.ps1

* Update start.ps1

* Update start.ps1

* Update start.ps1

* Update start.ps1

* Fix startup logging regression

---------

Co-authored-by: Chris Titus <contact@christitus.com>
2026-07-02 12:20:38 -05:00
Chris Titus 492d5b57d7 cleanup 2026-07-02 12:06:36 -05:00
Chris TitusandGitHub 58d37bb461 Clean up analyzer warnings across app search and ISO workflows (#4794)
* Clean up analyzer warnings

* Align analyzer warning cleanup policy

* Run PSScriptAnalyzer directly in unittests workflow

* Bind lazy-rendered buttons to click handlers

* Remove WinUtil performance tracing

* Fix Win11 ISO creator temp directory reuse
2026-07-02 12:05:25 -05:00
Sean (ANGRYxScotsman)andGitHub b72bfb03ba Update pre-release.yaml (#4746) 2026-07-02 11:01:18 -05:00
Chris Titus cc2be2d5e8 cleanup 2026-07-02 10:21:41 -05:00
138 changed files with 1088 additions and 1153 deletions
+8
View File
@@ -18,6 +18,14 @@ body:
- label: Yes, I did
required: true
- type: input
id: winutil_version
attributes:
label: "Version of WinUtil"
description: "Provide a version that you are using when issue submitted (it can be found in right corner of app)"
validations:
required: true
- type: dropdown
id: affected_part
attributes:
+1
View File
@@ -71,6 +71,7 @@ jobs:
labels: |
automated
documentation
skip-changelog
- name: Check outputs
run: |
@@ -1,77 +0,0 @@
name: Issue slash commands
on:
issue_comment:
types: [created, edited]
jobs:
issueCommands:
# Skip this job if the comment was created/edited on a PR
if: ${{ !github.event.issue.pull_request }}
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: none
contents: read
steps:
- name: Process slash command
uses: actions/github-script@v9
with:
script: |
const allowedUsers = ["ChrisTitusTech", "og-mrk", "Marterich", "MyDrift-user", "Real-MullaC", "CodingWonders", "GabiNun2", "FluffyPunk"];
const commenter = context.payload.comment.user.login;
// Authorization check first — before any parsing of comment content
if (!allowedUsers.includes(commenter)) {
console.log(`User ${commenter} is not in the allowlist. Skipping.`);
return;
}
// Read comment body as data, never interpolated into shell
const body = context.payload.comment.body;
const issueNumber = context.issue.number;
const owner = context.repo.owner;
const repo = context.repo.repo;
// /label 'name' or /label name
const labelMatch = body.match(/\/label\s+'([^']+)'|\/label\s+(\S+?)(?:\s|$)/);
if (labelMatch) {
const labelName = (labelMatch[1] || labelMatch[2]).trim();
console.log(`Adding label: ${labelName}`);
await github.rest.issues.addLabels({
owner, repo, issue_number: issueNumber,
labels: [labelName],
});
}
// /unlabel 'name' or /unlabel name
const unlabelMatch = body.match(/\/unlabel\s+'([^']+)'|\/unlabel\s+(\S+?)(?:\s|$)/);
if (unlabelMatch) {
const labelName = (unlabelMatch[1] || unlabelMatch[2]).trim();
console.log(`Removing label: ${labelName}`);
await github.rest.issues.removeLabel({
owner, repo, issue_number: issueNumber,
name: labelName,
});
}
// /close (optionally with 'not planned')
if (body.includes('/close')) {
const stateReason = body.includes('not planned') ? 'not_planned' : 'completed';
console.log(`Closing issue (reason: ${stateReason})`);
await github.rest.issues.update({
owner, repo, issue_number: issueNumber,
state: 'closed',
state_reason: stateReason,
});
}
// /open or /reopen
if (body.includes('/open') || body.includes('/reopen')) {
console.log('Reopening issue');
await github.rest.issues.update({
owner, repo, issue_number: issueNumber,
state: 'open',
});
}
+1 -1
View File
@@ -37,7 +37,7 @@ jobs:
with:
token: ${{ secrets.AUTO_MERGE }}
commit-message: 'chore: Update documentation links in JSON configs'
title: 'chore: Update Generated Dev Docs'
title: 'chore: Update documentation links in JSON configs'
body: 'Automated update of documentation links in JSON configs from pre-release build'
branch: docs-update
delete-branch: true
+3 -1
View File
@@ -32,7 +32,9 @@ jobs:
body: 'Automated update of sponsors section'
branch: sponsors-update
delete-branch: true
labels: automated
labels: |
automated
skip-changelog
- name: Check outputs
run: |
+16 -8
View File
@@ -9,14 +9,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: lint
uses: devblackops/github-action-psscriptanalyzer@master
with:
sendComment: false
settingsPath: lint/PSScriptAnalyser.ps1
failOnErrors: false
failOnWarnings: false
failOnInfos: false
- name: Install PSScriptAnalyzer
run: |
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-Module -Name PSScriptAnalyzer -RequiredVersion 1.20.0 -Scope CurrentUser -Force
Import-Module PSScriptAnalyzer -RequiredVersion 1.20.0 -Force
Get-Module PSScriptAnalyzer | Select-Object Name, Version, Path
shell: pwsh
- name: Run PSScriptAnalyzer
run: |
$results = Invoke-ScriptAnalyzer -Path . -Settings ./lint/PSScriptAnalyser.ps1 -Recurse
if ($results) {
$results | Format-Table -AutoSize | Out-String -Width 4096 | Write-Host
} else {
Write-Host "PSScriptAnalyzer found no diagnostics."
}
shell: pwsh
test:
runs-on: windows-latest
+3 -1
View File
@@ -188,4 +188,6 @@ When the user corrects an agent approach, add or tighten one concrete rule here
- Keep package install/uninstall process launches simple unless explicitly requested; do not add a separate stdout/stderr process logging helper for winget or Chocolatey.
- When the active log file is owned by `Start-Transcript`, do not call `Add-Content` against that file; write to host output so the transcript captures the line in the same log file without recording a terminating-error diagnostic.
- Log install/uninstall package names and package-manager IDs before queuing background runspace work; do not rely on runspace host output for the package identity.
- Keep performance tracing helpers under `tools/perf`; include them in generated output only through `Compile.ps1 -Trace`.
- For Win11 Creator, start each new ISO modification in a fresh `WinUtil_Win11ISO_*` temp directory; existing-work detection is only for resuming/exporting already modified media.
- For Script Analyzer cleanup, fix actionable source warnings first and do not globally suppress accepted convention warnings such as plural names, `ShouldProcess` on UI helpers, `$global:sync`, or compile-time cross-file false positives.
- For DNS DHCP reset, keep the cmdlet reset and explicitly set IPv4 and IPv6 DNS source to DHCP.
+3 -38
View File
@@ -1,27 +1,9 @@
param (
[switch]$Run,
[switch]$Trace
[switch]$Run
)
$OFS = "`r`n"
function Get-WinUtilTraceStrippedContent {
param(
[Parameter(Mandatory = $true)]
[string]$Content
)
if ($Trace) {
return $Content
}
$filteredLines = $Content -split "`r?`n" | Where-Object {
$_ -notmatch '^\s*(Start-WinUtilPerformanceTrace|Stop-WinUtilPerformanceTrace|Write-WinUtilPerformanceCheckpoint)\b'
}
$filteredLines -join "`r`n"
}
# Variable to sync between runspaces
$sync = [Hashtable]::Synchronized(@{})
$sync.configs = @{}
@@ -29,17 +11,7 @@ $sync.configs = @{}
$script = (Get-Content -Path scripts\start.ps1) -replace '#{replaceme}', (Get-Date -Format 'yy.MM.dd')
$script += Get-ChildItem -Path functions -Recurse -File | ForEach-Object {
Get-WinUtilTraceStrippedContent -Content (Get-Content -Path $_.FullName -Raw)
}
if ($Trace) {
$script += Get-ChildItem -Path tools\perf -Filter *.ps1 -File | Get-Content -Raw
$script += @'
$sync.PerformanceTraceEnabled = $true
Start-WinUtilPerformanceTrace
Write-WinUtilPerformanceCheckpoint -Name "Config load start"
'@
Get-Content -Path $_.FullName -Raw
}
Get-ChildItem config | ForEach-Object {
@@ -57,13 +29,6 @@ Get-ChildItem config | ForEach-Object {
$sync.configs[$_.BaseName] = $obj
$script += "`$sync.configs.$($_.BaseName) = @'`r`n$json`r`n'@ | ConvertFrom-Json"
if ($Trace) {
$script += "`r`nWrite-WinUtilPerformanceCheckpoint -Name `"Config $($_.BaseName) loaded`""
}
}
if ($Trace) {
$script += "`r`nWrite-WinUtilPerformanceCheckpoint -Name `"Config load complete`""
}
$xaml = Get-Content -Path xaml\inputXML.xaml -Raw
@@ -72,7 +37,7 @@ $script += "`$inputXML = @'`r`n$xaml`r`n'@"
$autounattendXml = Get-Content -Path tools\autounattend.xml -Raw
$script += "`$WinUtilAutounattendXml = @'`r`n$autounattendXml`r`n'@"
$script += Get-WinUtilTraceStrippedContent -Content (Get-Content -Path scripts\main.ps1 -Raw)
$script += Get-Content -Path scripts\main.ps1 -Raw
Set-Content -Path winutil.ps1 -Value $script
+1 -1
View File
@@ -77,7 +77,7 @@ See https://github.com/ChrisTitusTech/winutil/blob/main/.github/CONTRIBUTING.md
These are the sponsors that help keep this project alive with monthly contributions.
<!-- sponsors --><a href="https://github.com/dwelfusius"><img src="https:&#x2F;&#x2F;github.com&#x2F;dwelfusius.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/mews-se"><img src="https:&#x2F;&#x2F;github.com&#x2F;mews-se.png" width="60px" alt="User avatar: Martin Stockzell" /></a><a href="https://github.com/jdiegmueller"><img src="https:&#x2F;&#x2F;github.com&#x2F;jdiegmueller.png" width="60px" alt="User avatar: Jason A. Diegmueller" /></a><a href="https://github.com/robertsandrock"><img src="https:&#x2F;&#x2F;github.com&#x2F;robertsandrock.png" width="60px" alt="User avatar: RMS" /></a><a href="https://github.com/paulsheets"><img src="https:&#x2F;&#x2F;github.com&#x2F;paulsheets.png" width="60px" alt="User avatar: Paul" /></a><a href="https://github.com/djones369"><img src="https:&#x2F;&#x2F;github.com&#x2F;djones369.png" width="60px" alt="User avatar: Dave J (WhamGeek)" /></a><a href="https://github.com/anthonymendez"><img src="https:&#x2F;&#x2F;github.com&#x2F;anthonymendez.png" width="60px" alt="User avatar: Anthony Mendez" /></a><a href="https://github.com/FatBastard0"><img src="https:&#x2F;&#x2F;github.com&#x2F;FatBastard0.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/DursleyGuy"><img src="https:&#x2F;&#x2F;github.com&#x2F;DursleyGuy.png" width="60px" alt="User avatar: DursleyGuy" /></a><a href="https://github.com/DwayneTheRockLobster1"><img src="https:&#x2F;&#x2F;github.com&#x2F;DwayneTheRockLobster1.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/KieraKujisawa"><img src="https:&#x2F;&#x2F;github.com&#x2F;KieraKujisawa.png" width="60px" alt="User avatar: Kiera Meredith" /></a><a href="https://github.com/andrewpayne68"><img src="https:&#x2F;&#x2F;github.com&#x2F;andrewpayne68.png" width="60px" alt="User avatar: Andrew P" /></a><!-- sponsors -->
<!-- sponsors --><a href="https://github.com/ysaito8015"><img src="https:&#x2F;&#x2F;github.com&#x2F;ysaito8015.png" width="60px" alt="User avatar: Yusuke Saito" /></a><a href="https://github.com/dwelfusius"><img src="https:&#x2F;&#x2F;github.com&#x2F;dwelfusius.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/mews-se"><img src="https:&#x2F;&#x2F;github.com&#x2F;mews-se.png" width="60px" alt="User avatar: Martin Stockzell" /></a><a href="https://github.com/jdiegmueller"><img src="https:&#x2F;&#x2F;github.com&#x2F;jdiegmueller.png" width="60px" alt="User avatar: Jason A. Diegmueller" /></a><a href="https://github.com/robertsandrock"><img src="https:&#x2F;&#x2F;github.com&#x2F;robertsandrock.png" width="60px" alt="User avatar: RMS" /></a><a href="https://github.com/paulsheets"><img src="https:&#x2F;&#x2F;github.com&#x2F;paulsheets.png" width="60px" alt="User avatar: Paul" /></a><a href="https://github.com/djones369"><img src="https:&#x2F;&#x2F;github.com&#x2F;djones369.png" width="60px" alt="User avatar: Dave J (WhamGeek)" /></a><a href="https://github.com/anthonymendez"><img src="https:&#x2F;&#x2F;github.com&#x2F;anthonymendez.png" width="60px" alt="User avatar: Anthony Mendez" /></a><a href="https://github.com/FatBastard0"><img src="https:&#x2F;&#x2F;github.com&#x2F;FatBastard0.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/DursleyGuy"><img src="https:&#x2F;&#x2F;github.com&#x2F;DursleyGuy.png" width="60px" alt="User avatar: DursleyGuy" /></a><a href="https://github.com/DwayneTheRockLobster1"><img src="https:&#x2F;&#x2F;github.com&#x2F;DwayneTheRockLobster1.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/KieraKujisawa"><img src="https:&#x2F;&#x2F;github.com&#x2F;KieraKujisawa.png" width="60px" alt="User avatar: Kiera Meredith" /></a><a href="https://github.com/andrewpayne68"><img src="https:&#x2F;&#x2F;github.com&#x2F;andrewpayne68.png" width="60px" alt="User avatar: Andrew P" /></a><a href="https://github.com/johanwildeboer"><img src="https:&#x2F;&#x2F;github.com&#x2F;johanwildeboer.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/lukas346"><img src="https:&#x2F;&#x2F;github.com&#x2F;lukas346.png" width="60px" alt="User avatar: Wook" /></a><a href="https://github.com/tsv31"><img src="https:&#x2F;&#x2F;github.com&#x2F;tsv31.png" width="60px" alt="User avatar: Sorin" /></a><!-- sponsors -->
---
-107
View File
@@ -1,107 +0,0 @@
# Test TODO
Current suite status: broad parser, import, config JSON, compile, and runspace smoke coverage exists, but runtime behavior coverage is still very thin. Work from the top down; the first items are the highest-value gaps.
## P0 - Highest Priority
- [x] Add config reference integrity tests.
- Verify every preset entry points to an existing tweak, feature, app, appx item, or supported action.
- Verify `appnavigation.json` entries point to real tabs/panels and valid config groups.
- Verify tweak, feature, DNS, appx, and theme entries include all fields used by the UI/rendering code.
- Verify all embedded script strings in `config/*.json` parse as PowerShell when wrapped as scriptblocks.
- [x] Add XAML/control wiring tests.
- Load `xaml/inputXML.xaml` as XML and verify expected named controls exist.
- Verify controls referenced through `$sync["Name"]`, `$sync.Name`, or event handlers exist in XAML or are intentionally created dynamically.
- Verify `Invoke-WPF*` handler names used by buttons/tabs correspond to real functions.
- Verify core tabs, search controls, install panels, tweak panels, and Win11 Creator controls are present.
- [x] Add mock-based tests for registry and service helpers.
- Cover `Set-WinUtilRegistry` set/remove paths with `Mock New-Item`, `Mock Set-ItemProperty`, and `Mock Remove-ItemProperty`.
- Cover `Set-WinUtilService` for missing services, startup type changes, and no-op behavior.
- Assert command parameters instead of touching the real registry or services.
- [x] Add package selection and package manager tests.
- Cover `Get-WinUtilSelectedPackages` for winget-only, choco-only, mixed, `na`, empty, duplicate, and missing package entries.
- Cover `Test-WinUtilPackageManager` with mocked `Get-Command`.
- Cover `Install-WinUtilProgramWinget` and `Install-WinUtilProgramChoco` with mocked `Start-Process`, including install/uninstall arguments.
- [x] Add runspace behavior tests beyond the smoke test.
- Cover no argument list, one named parameter, multiple named parameters, and scriptblock failures.
- Assert callers receive a single `IAsyncResult`.
- Verify failure output/errors can be retrieved by the owning PowerShell instance.
- Add focused tests for public functions that call `Invoke-WPFRunspace` without executing their destructive inner work.
## P1 - Important Workflow Coverage
- [x] Add tweak execution orchestration tests.
- Cover `Invoke-WinUtilTweaks` with mocked `Invoke-WinUtilScript`, `Set-WinUtilRegistry`, `Set-WinUtilService`, and `Set-WinUtilDNS`.
- Verify undo mode uses `OriginalValue` and `OriginalType`.
- Verify DNS provider and progress counters are passed through correctly.
- [x] Add install/uninstall workflow tests.
- Cover `Invoke-WPFInstall` and `Invoke-WPFUnInstall` with mocked package sorting and mocked installers.
- Verify empty selection prompts and exits.
- Verify process-running guard prevents a second install/uninstall.
- Verify taskbar/progress cleanup happens on success and error.
- [x] Add update profile tests.
- Cover `Invoke-WPFUpdatesdisable`, `Invoke-WPFUpdatesdefault`, and `Invoke-WPFUpdatessecurity` with mocks for registry, services, scheduled tasks, and process calls.
- Assert intended registry paths, values, service startup types, and scheduled task paths.
- Keep all tests non-mutating.
- [x] Add AppX removal tests.
- Cover `Remove-WinUtilAPPX` with mocked `Get-AppxPackage` and `Remove-AppxPackage`.
- Cover `Invoke-WPFAppxRemoval` selection behavior and runspace parameter passing.
- Verify empty selection is handled without removal calls.
- [x] Add UI selection/state helper tests.
- Cover `Update-WinUtilSelections`, `Reset-WPFCheckBoxes`, `Invoke-WPFSelectedCheckboxesUpdate`, and `Invoke-WPFToggleAllCategories`.
- Use small fake checkbox/control objects instead of WPF windows where possible.
- Verify selected apps, tweaks, toggles, appx, and features stay in sync with checkbox state.
## P2 - Domain-Specific Coverage
- [x] Expand Win11 Creator tests.
- Test edition name to edition ID mapping.
- Test `ei.cfg` and `PID.txt` generation/removal behavior in a temp directory.
- Test autounattend conversion preserves required nodes and removes unsupported product key paths.
- Test driver injection branching with mocked DISM commands.
- Test ISO export fallback when `oscdimg.exe` is missing and winget install fails.
- [x] Add preferences/theme tests.
- Cover `Set-Preferences` loading, saving, old preference cleanup, and defaults.
- Cover theme resource updates without opening the full GUI.
- Verify theme config contains required brushes/colors used by the theme code.
- [x] Add search/filter tests.
- Cover `Find-AppsByNameOrDescription` and `Find-TweaksByNameOrDescription` with fake UI item trees.
- Verify empty search restores visibility.
- Verify category labels and panels hide/show correctly.
- Verify description and display-name matches both work.
- [x] Add compile contract tests.
- Verify compiled config key transformation for `applications.json` adds `WPFInstall` prefixes.
- Verify source ordering in `winutil.ps1`: start script, functions, configs, XAML, autounattend XML, main script.
- Verify generated build date placeholder is replaced.
- Verify generated script does not contain unresolved `#{replaceme}`.
## P3 - Nice To Have
- [ ] Add Script Analyzer as a failing CI gate once existing findings are triaged.
- [ ] Add docs generation/link checks for `docs/content`.
- [ ] Add coverage reporting in CI as informational output.
- [ ] Add a lightweight test helper module for fake `$sync`, fake WPF controls, and common mocks.
- [ ] Add regression tests whenever a production bug is fixed.
## Guardrails
- Tests must not mutate the real registry, services, scheduled tasks, package managers, AppX packages, USB disks, ISOs, or user profile state.
- Prefer Pester mocks and temp directories for system-facing code.
- Keep generated `winutil.ps1` ignored and never commit it.
- Run the full gate before marking test work complete:
```powershell
Import-Module Pester -RequiredVersion 5.8.0 -Force
Invoke-Pester -Path 'pester/*.Tests.ps1' -Output Detailed -CI
```
+22 -13
View File
@@ -530,6 +530,15 @@
"winget": "TechPowerUp.GPU-Z",
"foss": false
},
"gsudo": {
"category": "Pro Tools",
"choco": "gsudo",
"content": "gsudo",
"description": "gsudo is a sudo equivalent for Windows. It allows you to run commands with elevated administrative privileges directly within the current console window.",
"link": "https://github.com/gerardog/gsudo",
"winget": "gerardog.gsudo",
"foss": true
},
"helium": {
"category": "Browsers",
"choco": "helium",
@@ -719,15 +728,6 @@
"winget": "XBMCFoundation.Kodi",
"foss": true
},
"lightshot": {
"category": "Multimedia Tools",
"choco": "lightshot",
"content": "Lightshot",
"description": "The fastest way to take a customizable screenshot.",
"link": "https://app.prntscr.com/",
"winget": "Skillbrains.Lightshot",
"foss": false
},
"lazygit": {
"category": "Development",
"choco": "lazygit",
@@ -782,6 +782,15 @@
"winget": "Element.Element",
"foss": true
},
"minitoolpartitionwizard": {
"category": "Utilities",
"choco": "minitoolpartitionwizard",
"content": "MiniTool Partition Wizard",
"description": "Comprehensive free partition manager that performs advanced operations Windows natively cannot, such as merging partitions, converting file systems, and organizing disk capacity.",
"link": "https://www.partitionwizard.com/",
"winget": "MiniTool.PartitionWizard.Free",
"foss": false
},
"modrinth": {
"category": "Games",
"choco": "modrinth-app",
@@ -1198,7 +1207,7 @@
"processmonitor": {
"category": "Microsoft Tools",
"choco": "procexp",
"content": "SysInternals Process Monitor",
"content": "Process Monitor",
"description": "SysInternals Process Monitor is an advanced monitoring tool that shows real-time file system, registry, and process/thread activity.",
"link": "https://docs.microsoft.com/en-us/sysinternals/downloads/procmon",
"winget": "Microsoft.Sysinternals.ProcessMonitor",
@@ -1387,7 +1396,7 @@
"tcpview": {
"category": "Microsoft Tools",
"choco": "tcpview",
"content": "SysInternals TCPView",
"content": "TCPView",
"description": "SysInternals TCPView is a network monitoring tool that displays a detailed list of all TCP and UDP endpoints on your system.",
"link": "https://docs.microsoft.com/en-us/sysinternals/downloads/tcpview",
"winget": "Microsoft.Sysinternals.TCPView",
@@ -1504,7 +1513,7 @@
"ungoogled": {
"category": "Browsers",
"choco": "ungoogled-chromium",
"content": "Ungoogled",
"content": "Ungoogled Chromium",
"description": "Ungoogled Chromium is a version of Chromium without Google's integration for enhanced privacy and control.",
"link": "https://github.com/Eloston/ungoogled-chromium",
"winget": "eloston.ungoogled-chromium",
@@ -1522,7 +1531,7 @@
"everything": {
"category": "Utilities",
"choco": "everything",
"content": "VoidTools Everything",
"content": "Everything",
"description": "Everything is a search engine that locates files and folders by filename instantly for Windows. Unlike Windows search Everything initially displays every file and folder on your computer (hence the name Everything). You type in a search filter to limit what files and folders are displayed.",
"link": "https://www.voidtools.com/",
"winget": "voidtools.Everything",
+52 -8
View File
@@ -179,6 +179,17 @@
"function": "Invoke-WPFFixesWinget",
"link": "https://winutil.christitus.com/dev/features/fixes/winget"
},
"WPFPanelComputer": {
"Content": "Computer Management",
"category": "Legacy Windows Panels",
"panel": "2",
"Type": "Button",
"ButtonWidth": "300",
"InvokeScript": [
"compmgmt.msc"
],
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/computer"
},
"WPFPanelControl": {
"Content": "Control Panel",
"category": "Legacy Windows Panels",
@@ -190,16 +201,16 @@
],
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/control"
},
"WPFPanelComputer": {
"Content": "Computer Management",
"WPFPanelMouse": {
"Content": "Mouse Properties",
"category": "Legacy Windows Panels",
"panel": "2",
"Type": "Button",
"ButtonWidth": "300",
"InvokeScript": [
"compmgmt.msc"
"main.cpl"
],
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/computer"
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/mouse"
},
"WPFPanelNetwork": {
"Content": "Network Connections",
@@ -234,6 +245,17 @@
],
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/printer"
},
"WPFPanelPrograms": {
"Content": "Programs and Features",
"category": "Legacy Windows Panels",
"panel": "2",
"Type": "Button",
"ButtonWidth": "300",
"InvokeScript": [
"appwiz.cpl"
],
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/programs"
},
"WPFPanelRegion": {
"Content": "Region",
"category": "Legacy Windows Panels",
@@ -245,16 +267,16 @@
],
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/region"
},
"WPFPanelRestore": {
"Content": "Windows Restore",
"WPFPanelSecurity": {
"Content": "Security and Maintenance",
"category": "Legacy Windows Panels",
"panel": "2",
"Type": "Button",
"ButtonWidth": "300",
"InvokeScript": [
"rstrui.exe"
"wscui.cpl"
],
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/restore"
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/security"
},
"WPFPanelSound": {
"Content": "Sound Settings",
@@ -289,6 +311,28 @@
],
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/timedate"
},
"WPFPanelFirewall": {
"Content": "Windows Defender Firewall",
"category": "Legacy Windows Panels",
"panel": "2",
"Type": "Button",
"ButtonWidth": "300",
"InvokeScript": [
"firewall.cpl"
],
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/firewall"
},
"WPFPanelRestore": {
"Content": "Windows Restore",
"category": "Legacy Windows Panels",
"panel": "2",
"Type": "Button",
"ButtonWidth": "300",
"InvokeScript": [
"rstrui.exe"
],
"link": "https://winutil.christitus.com/dev/features/legacy-windows-panels/restore"
},
"WPFWinUtilInstallPSProfile": {
"Content": "CTT PowerShell Profile - Install",
"category": "Powershell Profile Powershell 7+ Only",
+5 -4
View File
@@ -1,9 +1,10 @@
{
"shared": {
"AppEntryWidth": "200",
"AppEntryFontSize": "11",
"AppEntryMargin": "1,0,1,0",
"AppEntryBorderThickness": "0",
"AppEntryWidth": "220",
"AppEntryFontSize": "13.2",
"AppEntryIconSize": "28",
"AppEntryMargin": "3",
"AppEntryBorderThickness": "1",
"CustomDialogFontSize": "12",
"CustomDialogFontSizeHeader": "14",
"CustomDialogLogoSize": "25",
+39 -4
View File
@@ -429,7 +429,7 @@
},
"WPFTweaksConsumerFeatures": {
"Content": "ConsumerFeatures - Disable",
"Description": "Windows will not automatically install any games, third-party apps, or application links from the Windows Store for the signed-in user. Some default Apps will be inaccessible (e.g. Phone Link).",
"Description": "Stops promoted app installs and reduces app suggestions from Microsoft Store content.",
"category": "Essential Tweaks",
"panel": "1",
"registry": [
@@ -913,6 +913,7 @@
New-Item \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Appx\\AppxAllUserStore\\EndOfLife\\$Sid\\$Appx\" -Force
Get-AppxPackage -AllUsers \"*Copilot*\" | Remove-AppxPackage -AllUsers
winget uninstall -e --name \"Copilot\" --silent --force --accept-source-agreements 2>$null
Get-AppxPackage -AllUsers Microsoft.MicrosoftOfficeHub | Remove-AppxPackage -AllUsers
if ($Appx) {
@@ -943,6 +944,22 @@
],
"link": "https://winutil.christitus.com/dev/tweaks/essential-tweaks/wpbt"
},
"WPFTweaksPreventDeviceMetadataFromNetwork": {
"Content": "Prevent Device Companion Apps",
"Description": "Prevents additional software from being installed when plugging in devices (e.g. Ads when plugging in a monitor). Poses potential security risk.",
"category": "Essential Tweaks",
"panel": "1",
"registry": [
{
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Device Metadata",
"Name": "PreventDeviceMetadataFromNetwork",
"Value": "1",
"Type": "DWord",
"OriginalValue": "<RemoveEntry>"
}
],
"link": "https://winutil.christitus.com/dev/tweaks/essential-tweaks/preventdevicemetadatafromnetwork"
},
"WPFTweaksRazerBlock": {
"Content": "Razer Software Auto-Install - Disable",
"Description": "Blocks ALL Razer Software installations. The hardware works fine without any software.",
@@ -1461,10 +1478,10 @@
{
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\GraphicsDrivers",
"Name": "DisableOverlays",
"Value": "1",
"Value": "0",
"Type": "DWord",
"OriginalValue": "0",
"DefaultState": "false"
"OriginalValue": "1",
"DefaultState": "true"
}
],
"link": "https://winutil.christitus.com/dev/tweaks/customize-preferences/multiplaneoverlay"
@@ -1529,6 +1546,24 @@
],
"link": "https://winutil.christitus.com/dev/tweaks/customize-preferences/numlock"
},
"WPFToggleWindowSnapping": {
"Content": "Window Snapping",
"Description": "Toggles the window snapping feature when dragging windows.",
"category": "Customize Preferences",
"panel": "2",
"Type": "Toggle",
"registry": [
{
"Path": "HKCU:\\Control Panel\\Desktop",
"Name": "WindowArrangementActive",
"Value": "1",
"Type": "String",
"OriginalValue": "0",
"DefaultState": "true"
}
],
"link": "https://winutil.christitus.com/dev/tweaks/customize-preferences/windowsnapping"
},
"WPFToggleStandbyFix": {
"Content": "S0 Sleep Network Connectivity",
"Description": "Toggles network connectivity during S0 Sleep which is low power idle in modern laptops.",
+15
View File
@@ -30,3 +30,18 @@ In these cases, the power plan may fail to apply, This is expected behavior on u
Revert start menu tweak stops working starting with **Windows 11 update KB5089573** (released in May 2026).
In this update, Microsoft completely removed the old Start Menu code from Windows, so we aren't able to bring it back.
### Issues with PowerShell 7 or Class not registered Error
Installing PowerShell 7 from the Microsoft Store (MSIX package) is known to cause issues with DISM cmdlets such as `Get-WindowsOptionalFeature` and `Enable-WindowsOptionalFeature`, resulting in a `Class not registered` COM error.
This might also make it so running the "pre-installed app removal" will take a indefinite amount of time
Instead, install PowerShell 7 using one of the following methods:
**winget (recommended):**
```powershell
winget install --id Microsoft.PowerShell --source winget --installer-type wix
```
**Direct MSI from GitHub Releases:** Download the `.msi` installer from the [PowerShell GitHub Releases](https://github.com/PowerShell/PowerShell/releases) page.
For more details see https://github.com/PowerShell/PowerShell/issues/13866
+1 -1
View File
@@ -5,7 +5,7 @@ toc: false
---
> [!NOTE]
> This section contains technical documentation for developers. For end-user documentation, see the [User Guide](../userguide/).
> This section contains code-only references. For end-user documentation, see the [User Guide](../userguide/).
## Architecture
@@ -3,7 +3,7 @@ title: "Computer Management"
description: ""
---
```json {filename="config/feature.json",linenos=inline,linenostart=193}
```json {filename="config/feature.json",linenos=inline,linenostart=182}
"WPFPanelComputer": {
"Content": "Computer Management",
"category": "Legacy Windows Panels",
@@ -3,7 +3,7 @@ title: "Control Panel"
description: ""
---
```json {filename="config/feature.json",linenos=inline,linenostart=182}
```json {filename="config/feature.json",linenos=inline,linenostart=193}
"WPFPanelControl": {
"Content": "Control Panel",
"category": "Legacy Windows Panels",
@@ -0,0 +1,16 @@
---
title: "Windows Defender Firewall"
description: ""
---
```json {filename="config/feature.json",linenos=inline,linenostart=314}
"WPFPanelFirewall": {
"Content": "Windows Defender Firewall",
"category": "Legacy Windows Panels",
"panel": "2",
"Type": "Button",
"ButtonWidth": "300",
"InvokeScript": [
"firewall.cpl"
],
```
@@ -0,0 +1,16 @@
---
title: "Mouse Properties"
description: ""
---
```json {filename="config/feature.json",linenos=inline,linenostart=204}
"WPFPanelMouse": {
"Content": "Mouse Properties",
"category": "Legacy Windows Panels",
"panel": "2",
"Type": "Button",
"ButtonWidth": "300",
"InvokeScript": [
"main.cpl"
],
```
@@ -3,7 +3,7 @@ title: "Network Connections"
description: ""
---
```json {filename="config/feature.json",linenos=inline,linenostart=204}
```json {filename="config/feature.json",linenos=inline,linenostart=215}
"WPFPanelNetwork": {
"Content": "Network Connections",
"category": "Legacy Windows Panels",
@@ -3,7 +3,7 @@ title: "Power Panel"
description: ""
---
```json {filename="config/feature.json",linenos=inline,linenostart=215}
```json {filename="config/feature.json",linenos=inline,linenostart=226}
"WPFPanelPower": {
"Content": "Power Panel",
"category": "Legacy Windows Panels",
@@ -3,7 +3,7 @@ title: "Printer Panel"
description: ""
---
```json {filename="config/feature.json",linenos=inline,linenostart=226}
```json {filename="config/feature.json",linenos=inline,linenostart=237}
"WPFPanelPrinter": {
"Content": "Printer Panel",
"category": "Legacy Windows Panels",
@@ -0,0 +1,16 @@
---
title: "Programs and Features"
description: ""
---
```json {filename="config/feature.json",linenos=inline,linenostart=248}
"WPFPanelPrograms": {
"Content": "Programs and Features",
"category": "Legacy Windows Panels",
"panel": "2",
"Type": "Button",
"ButtonWidth": "300",
"InvokeScript": [
"appwiz.cpl"
],
```
@@ -3,7 +3,7 @@ title: "Region"
description: ""
---
```json {filename="config/feature.json",linenos=inline,linenostart=237}
```json {filename="config/feature.json",linenos=inline,linenostart=259}
"WPFPanelRegion": {
"Content": "Region",
"category": "Legacy Windows Panels",
@@ -3,7 +3,7 @@ title: "Windows Restore"
description: ""
---
```json {filename="config/feature.json",linenos=inline,linenostart=248}
```json {filename="config/feature.json",linenos=inline,linenostart=325}
"WPFPanelRestore": {
"Content": "Windows Restore",
"category": "Legacy Windows Panels",
@@ -0,0 +1,16 @@
---
title: "Security and Maintenance"
description: ""
---
```json {filename="config/feature.json",linenos=inline,linenostart=270}
"WPFPanelSecurity": {
"Content": "Security and Maintenance",
"category": "Legacy Windows Panels",
"panel": "2",
"Type": "Button",
"ButtonWidth": "300",
"InvokeScript": [
"wscui.cpl"
],
```
@@ -3,7 +3,7 @@ title: "Sound Settings"
description: ""
---
```json {filename="config/feature.json",linenos=inline,linenostart=259}
```json {filename="config/feature.json",linenos=inline,linenostart=281}
"WPFPanelSound": {
"Content": "Sound Settings",
"category": "Legacy Windows Panels",
@@ -3,7 +3,7 @@ title: "System Properties"
description: ""
---
```json {filename="config/feature.json",linenos=inline,linenostart=270}
```json {filename="config/feature.json",linenos=inline,linenostart=292}
"WPFPanelSystem": {
"Content": "System Properties",
"category": "Legacy Windows Panels",
@@ -3,7 +3,7 @@ title: "Time and Date"
description: ""
---
```json {filename="config/feature.json",linenos=inline,linenostart=281}
```json {filename="config/feature.json",linenos=inline,linenostart=303}
"WPFPanelTimedate": {
"Content": "Time and Date",
"category": "Legacy Windows Panels",
@@ -14,7 +14,7 @@ function Invoke-WinUtilInstallPSProfile {
if (-not (Get-Command pwsh)) {
Write-Host "PowerShell 7 not found. Installing..."
Install-WinUtilWinget
winget install Microsoft.PowerShell --source winget --silent
winget install Microsoft.PowerShell --source winget --installer-type wix --silent
}
wt new-tab pwsh -NoExit -Command "irm https://github.com/ChrisTitusTech/powershell-profile/raw/main/setup.ps1 | iex"
@@ -3,7 +3,7 @@ title: "System Tray Battery Percentage"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1251}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1268}
"WPFToggleBatteryPercentage": {
"Content": "System Tray Battery Percentage",
"Description": "Shows numeric battery percentage next to the battery icon in the system tray.",
@@ -3,7 +3,7 @@ title: "Start Menu Bing Search"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1586}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1621}
"WPFToggleBingSearch": {
"Content": "Start Menu Bing Search",
"Description": "Toggles Bing web search results in Windows Search.",
@@ -3,7 +3,7 @@ title: "Dark Theme for Windows"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1269}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1286}
"WPFToggleDarkMode": {
"Content": "Dark Theme for Windows",
"Description": "Dark Mode for the system and applications.",
@@ -3,7 +3,7 @@ title: "BSoD Verbose Mode"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1225}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1242}
"WPFToggleDetailedBSoD": {
"Content": "BSoD Verbose Mode",
"Description": "Gives more information when you blue screen.",
@@ -3,7 +3,7 @@ title: "Lock Screen - Disable"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1622}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1657}
"WPFTweaksDisableLockscreen": {
"Content": "Lock Screen - Disable",
"Description": "Skips the lock screen entirely and goes directly to the sign-in screen on boot and wake.",
@@ -3,7 +3,7 @@ title: "Game Mode"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1765}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1800}
"WPFToggleGameMode": {
"Content": "Game Mode",
"Description": "Toggles Windows prioritizes gaming performance by allocating system resources to games.",
@@ -3,7 +3,7 @@ title: "File Explorer Hidden Files"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1339}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1356}
"WPFToggleHiddenFiles": {
"Content": "File Explorer Hidden Files",
"Description": "Reveals hidden files in Explorer.",
@@ -3,7 +3,7 @@ title: "Settings Home Page"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1568}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1603}
"WPFToggleHideSettingsHome": {
"Content": "Settings Home Page",
"Description": "Toggles the Home Page in the Windows Settings app.",
@@ -3,7 +3,7 @@ title: "Logon Screen Acrylic Blur"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1604}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1639}
"WPFToggleLoginBlur": {
"Content": "Logon Screen Acrylic Blur",
"Description": "Toggles the acrylic blur effect on login screen background.",
@@ -3,7 +3,7 @@ title: "Enable Long Paths"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1791}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1826}
"WPFToggleLongPaths": {
"Content": "Enable Long Paths",
"Description": "Toggles support for file paths longer than 260 characters in Explorer.",
@@ -3,7 +3,7 @@ title: "Mouse Acceleration"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1472}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1489}
"WPFToggleMouseAcceleration": {
"Content": "Mouse Acceleration",
"Description": "Makes it so Cursor movement is affected by the speed of your physical mouse movements.",
@@ -3,7 +3,7 @@ title: "Multiplane Overlay"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1446}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1463}
"WPFToggleMultiplaneOverlay": {
"Content": "Multiplane Overlay",
"Description": "Multiplane Overlay compose multiple image layers, which can sometimes cause issues with graphics cards.",
@@ -22,10 +22,10 @@ description: ""
{
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\GraphicsDrivers",
"Name": "DisableOverlays",
"Value": "1",
"Value": "0",
"Type": "DWord",
"OriginalValue": "0",
"DefaultState": "false"
"OriginalValue": "1",
"DefaultState": "true"
}
],
```
@@ -3,7 +3,7 @@ title: "Microsoft Outlook New Version"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1385}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1402}
"WPFToggleNewOutlook": {
"Content": "Microsoft Outlook New Version",
"Description": "This will ensures the classic Outlook application is used.",
@@ -3,7 +3,7 @@ title: "Num Lock on Startup"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1506}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1523}
"WPFToggleNumLock": {
"Content": "Num Lock on Startup",
"Description": "Toggle the Num Lock key state when your computer starts.",
@@ -3,7 +3,7 @@ title: "S3 Sleep"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1550}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1585}
"WPFToggleS3Sleep": {
"Content": "S3 Sleep",
"Description": "Toggles between Modern Standby and S3 Sleep, which cuts off power to the CPU while continuing to refresh the memory.",
@@ -3,7 +3,7 @@ title: "Scrollbars Always Visible"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1427}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1444}
"WPFToggleScrollbars": {
"Content": "Scrollbars Always Visible",
"Description": "If enabled, scrollbars will always be visible. If disabled, Windows will automatically hide scrollbars when not in use.",
@@ -3,7 +3,7 @@ title: "File Explorer File Extensions"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1311}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1328}
"WPFToggleShowExt": {
"Content": "File Explorer File Extensions",
"Description": "Shows .file extensions in Explorer (.exe, .png, etc.)",
@@ -3,7 +3,7 @@ title: "S0 Sleep Network Connectivity"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1532}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1567}
"WPFToggleStandbyFix": {
"Content": "S0 Sleep Network Connectivity",
"Description": "Toggles network connectivity during S0 Sleep which is low power idle in modern laptops.",
@@ -3,7 +3,7 @@ title: "Start Menu Recommendations"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1639}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1674}
"WPFToggleStartMenuRecommendations": {
"Content": "Start Menu Recommendations",
"Description": "Toggles the recommendations section in the Start Menu. WARNING: This will also disable Windows Spotlight on your Lock Screen as a side effect.",
@@ -3,7 +3,7 @@ title: "Sticky Keys"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1683}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1718}
"WPFToggleStickyKeys": {
"Content": "Sticky Keys",
"Description": "Toggles the Sticky Keys, which activate when clicking shift rapidly.",
@@ -3,7 +3,7 @@ title: "Taskbar Task View Icon"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1747}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1782}
"WPFToggleTaskView": {
"Content": "Taskbar Task View Icon",
"Description": "Toggles the Task View Button in the Taskbar.",
@@ -3,7 +3,7 @@ title: "Taskbar Centered Icons"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1701}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1736}
"WPFToggleTaskbarAlignment": {
"Content": "Taskbar Centered Icons",
"Description": "Toggles the Taskbar alignment either to the left or center.",
@@ -3,7 +3,7 @@ title: "Taskbar Search Icon"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1729}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1764}
"WPFToggleTaskbarSearch": {
"Content": "Taskbar Search Icon",
"Description": "Toggles the Search Button on the Taskbar.",
@@ -3,7 +3,7 @@ title: "Logon Verbose Mode"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1367}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1384}
"WPFToggleVerboseLogon": {
"Content": "Logon Verbose Mode",
"Description": "Show detailed messages during startup/shutdown.",
@@ -0,0 +1,29 @@
---
title: "Window Snapping"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1549}
"WPFToggleWindowSnapping": {
"Content": "Window Snapping",
"Description": "Toggles the window snapping feature when dragging windows.",
"category": "Customize Preferences",
"panel": "2",
"Type": "Toggle",
"registry": [
{
"Path": "HKCU:\\Control Panel\\Desktop",
"Name": "WindowArrangementActive",
"Value": "1",
"Type": "String",
"OriginalValue": "0",
"DefaultState": "true"
}
],
```
## Registry Changes
Applications and System Components store and retrieve configuration data to modify Windows settings, so we can use the registry to change many settings in one place.
You can find information about the registry on [Wikipedia](https://en.wikipedia.org/wiki/Windows_Registry) and [Microsoft's Website](https://learn.microsoft.com/en-us/windows/win32/sysinfo/registry).
@@ -6,7 +6,7 @@ description: ""
```json {filename="config/tweaks.json",linenos=inline,linenostart=430}
"WPFTweaksConsumerFeatures": {
"Content": "ConsumerFeatures - Disable",
"Description": "Windows will not automatically install any games, third-party apps, or application links from the Windows Store for the signed-in user. Some default Apps will be inaccessible (e.g. Phone Link).",
"Description": "Stops promoted app installs and reduces app suggestions from Microsoft Store content.",
"category": "Essential Tweaks",
"panel": "1",
"registry": [
@@ -3,7 +3,7 @@ title: "Temporary Files - Remove"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1065}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1082}
"WPFTweaksDeleteTempFiles": {
"Content": "Temporary Files - Remove",
"Description": "Erases TEMP Folders.",
@@ -3,7 +3,7 @@ title: "File Explorer Automatic Folder Discovery - Disable"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1170}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1187}
"WPFTweaksDisableExplorerAutoDiscovery": {
"Content": "File Explorer Automatic Folder Discovery - Disable",
"Description": "Windows Explorer automatically tries to guess the type of the folder based on its contents, slowing down the browsing experience. WARNING! Will disable File Explorer grouping.",
@@ -3,7 +3,7 @@ title: "Disk Cleanup - Run"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1052}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1069}
"WPFTweaksDiskCleanup": {
"Content": "Disk Cleanup - Run",
"Description": "Runs Disk Cleanup on Drive C: and removes old Windows Updates.",
@@ -0,0 +1,27 @@
---
title: "Prevent Device Companion Apps"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=947}
"WPFTweaksPreventDeviceMetadataFromNetwork": {
"Content": "Prevent Device Companion Apps",
"Description": "Prevents additional software from being installed when plugging in devices (e.g. Ads when plugging in a monitor). Poses potential security risk.",
"category": "Essential Tweaks",
"panel": "1",
"registry": [
{
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Device Metadata",
"Name": "PreventDeviceMetadataFromNetwork",
"Value": "1",
"Type": "DWord",
"OriginalValue": "<RemoveEntry>"
}
],
```
## Registry Changes
Applications and System Components store and retrieve configuration data to modify Windows settings, so we can use the registry to change many settings in one place.
You can find information about the registry on [Wikipedia](https://en.wikipedia.org/wiki/Windows_Registry) and [Microsoft's Website](https://learn.microsoft.com/en-us/windows/win32/sysinfo/registry).
@@ -3,7 +3,7 @@ title: "Windows Platform Binary Table (WPBT) - Disable"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=930}
```json {filename="config/tweaks.json",linenos=inline,linenostart=931}
"WPFTweaksWPBT": {
"Content": "Windows Platform Binary Table (WPBT) - Disable",
"Description": "If enabled, WPBT allows your computer vendor to execute programs at boot time, such as anti-theft software, software drivers, as well as force install software without user consent. Poses potential security risk.",
@@ -3,7 +3,7 @@ title: "Adobe URL Block List - Enable"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1010}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1027}
"WPFTweaksBlockAdobeNet": {
"Content": "Adobe URL Block List - Enable",
"Description": "Reduces user interruptions by selectively blocking connections to Adobe's activation and telemetry servers. Credit: Ruddernation-Designs",
@@ -3,7 +3,7 @@ title: "Background Apps - Disable"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1138}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1155}
"WPFTweaksDisableBGapps": {
"Content": "Background Apps - Disable",
"Description": "Disables all Microsoft Store apps from running in the background, which has to be done individually since Windows 11.",
@@ -3,7 +3,7 @@ title: "Fullscreen Optimizations - Disable"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1154}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1171}
"WPFTweaksDisableFSO": {
"Content": "Fullscreen Optimizations - Disable",
"Description": "Disables FSO in all applications. NOTE: This will disable Color Management in Exclusive Fullscreen.",
@@ -3,7 +3,7 @@ title: "IPv6 - Disable"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1116}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1133}
"WPFTweaksDisableIPv6": {
"Content": "IPv6 - Disable",
"Description": "Disables IPv6.",
@@ -3,7 +3,7 @@ title: "System Tray Notifications & Calendar - Disable"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=987}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1004}
"WPFTweaksDisableNotifications": {
"Content": "System Tray Notifications & Calendar - Disable",
"Description": "Disables all Notifications INCLUDING Calendar.",
@@ -3,7 +3,7 @@ title: "IPv6 - Set IPv4 as Preferred"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1078}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1095}
"WPFTweaksIPv46": {
"Content": "IPv6 - Set IPv4 as Preferred",
"Description": "Setting the IPv4 preference can have latency and security benefits on private networks where IPv6 is not configured.",
@@ -3,7 +3,7 @@ title: "Razer Software Auto-Install - Disable"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=946}
```json {filename="config/tweaks.json",linenos=inline,linenostart=963}
"WPFTweaksRazerBlock": {
"Content": "Razer Software Auto-Install - Disable",
"Description": "Blocks ALL Razer Software installations. The hardware works fine without any software.",
@@ -3,7 +3,7 @@ title: "Right-Click Menu Previous Layout - Enable"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1036}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1053}
"WPFTweaksRightClickMenu": {
"Content": "Right-Click Menu Previous Layout - Enable",
"Description": "Restores the classic context menu when right-clicking in File Explorer, replacing the simplified Windows 11 version.",
@@ -3,7 +3,7 @@ title: "Teredo - Disable"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1094}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1111}
"WPFTweaksTeredo": {
"Content": "Teredo - Disable",
"Description": "Teredo network tunneling is an IPv6 feature that can cause additional latency, but may cause problems with some games.",
@@ -33,6 +33,7 @@ description: ""
New-Item \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Appx\\AppxAllUserStore\\EndOfLife\\$Sid\\$Appx\" -Force
Get-AppxPackage -AllUsers \"*Copilot*\" | Remove-AppxPackage -AllUsers
winget uninstall -e --name \"Copilot\" --silent --force --accept-source-agreements 2>$null
Get-AppxPackage -AllUsers Microsoft.MicrosoftOfficeHub | Remove-AppxPackage -AllUsers
if ($Appx) {
@@ -3,7 +3,7 @@ title: "DNS - Set to:"
description: ""
---
```json {filename="config/tweaks.json",linenos=inline,linenostart=1816}
```json {filename="config/tweaks.json",linenos=inline,linenostart=1851}
"WPFchangedns": {
"Content": "DNS - Set to:",
"category": "z__Advanced Tweaks - CAUTION",
@@ -83,9 +83,9 @@ function Find-AppsByNameOrDescription {
$categoryLabel.Visibility = [Windows.Visibility]::Visible
# Search through apps in this category
$wrapPanel.Children | ForEach-Object {
foreach ($appControl in $wrapPanel.Children) {
# Safely retrieve app entry from hashtable
$appTag = $_.Tag
$appTag = $appControl.Tag
$appEntry = $null
if (-not [string]::IsNullOrWhiteSpace($appTag) -and $sync.configs.applicationsHashtable.ContainsKey($appTag)) {
@@ -99,16 +99,16 @@ function Find-AppsByNameOrDescription {
if ($contentMatch -or $descriptionMatch) {
# Show the App and mark that this category has a match
$_.Visibility = [Windows.Visibility]::Visible
$appControl.Visibility = [Windows.Visibility]::Visible
$categoryHasMatch = $true
}
else {
$_.Visibility = [Windows.Visibility]::Collapsed
$appControl.Visibility = [Windows.Visibility]::Collapsed
}
}
else {
# Hide app if no entry found (data integrity issue)
$_.Visibility = [Windows.Visibility]::Collapsed
$appControl.Visibility = [Windows.Visibility]::Collapsed
}
}
@@ -114,6 +114,7 @@ function Find-TweaksByNameOrDescription {
}
catch {
# Silent catch - UI element may be disposed
$null = $_
}
return
@@ -303,5 +304,6 @@ function Find-TweaksByNameOrDescription {
catch {
# Silent catch - UI elements may be disposed or in unexpected state
# Do not log to terminal as this function is called on every keystroke
$null = $_
}
}
@@ -4,7 +4,7 @@ function Get-WinUtilPackageLogSummary {
[object[]]$Packages,
[Parameter(Mandatory = $true)]
[PackageManagers]$Preference
[string]$Preference
)
@($Packages | ForEach-Object {
@@ -17,7 +17,7 @@ function Get-WinUtilPackageLogSummary {
$packageName = "Unknown package"
}
if ($Preference -eq [PackageManagers]::Choco -and -not [string]::IsNullOrWhiteSpace([string]$package.choco) -and $package.choco -ne "na") {
if ($Preference -eq "Choco" -and -not [string]::IsNullOrWhiteSpace([string]$package.choco) -and $package.choco -ne "na") {
"$packageName (choco: $($package.choco))"
} elseif (-not [string]::IsNullOrWhiteSpace([string]$package.winget) -and $package.winget -ne "na") {
"$packageName (winget: $($package.winget))"
@@ -3,9 +3,9 @@ function Get-WinUtilSelectedPackages {
param(
[Parameter(Mandatory = $true)]
[object] $PackageList,
[Parameter(Mandatory = $true)]
[PackageManagers] $Preference
[string] $Preference
)
if ($PackageList.count -eq 1) {
@@ -14,12 +14,12 @@ function Get-WinUtilSelectedPackages {
Invoke-WPFUIThread -ScriptBlock { Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo" }
}
$packages = [System.Collections.Hashtable]::new()
$packagesWinget = [System.Collections.ArrayList]::new()
$packagesChoco = [System.Collections.ArrayList]::new()
$packages[[PackageManagers]::Winget] = $packagesWinget
$packages[[PackageManagers]::Choco] = $packagesChoco
$packages = @{
Winget = $packagesWinget
Choco = $packagesChoco
}
function Add-PackageId {
param(
+3 -2
View File
@@ -19,8 +19,9 @@ function Get-WinUtilVariables {
if ($Type -contains $objType) {
Write-Output $psitem
}
} catch {
<#I am here so errors don't get outputted for a couple variables that don't have the .GetType() attribute#>
}
catch {
$null = $_
}
}
return $output
@@ -60,6 +60,30 @@ function Initialize-InstallAppEntry {
$borderElement.SetResourceReference([Windows.Controls.Control]::BackgroundProperty, "AppInstallUnselectedColor")
})
$contentPanel = New-Object Windows.Controls.StackPanel
$contentPanel.Orientation = "Horizontal"
$contentPanel.VerticalAlignment = [Windows.VerticalAlignment]::Center
$icon = New-Object Windows.Controls.Grid
$icon.SetResourceReference([Windows.FrameworkElement]::WidthProperty, "AppEntryIconSize")
$icon.SetResourceReference([Windows.FrameworkElement]::HeightProperty, "AppEntryIconSize")
$icon.Margin = New-Object Windows.Thickness(0, 0, 8, 0)
$fallback = New-Object Windows.Controls.TextBlock
$fallback.Text = $app.content.TrimStart(".").Substring(0, 1).ToUpper()
$fallback.FontWeight = "Bold"; $fallback.HorizontalAlignment = "Center"; $fallback.VerticalAlignment = "Center"
if ($app.link) { $fallback.Visibility = "Collapsed" }
$fallback.SetResourceReference([Windows.Controls.TextBlock]::FontSizeProperty, "AppEntryFontSize")
$fallback.SetResourceReference([Windows.Controls.TextBlock]::ForegroundProperty, "ToggleButtonOnColor")
[void]$icon.Children.Add($fallback)
if ($app.link) {
$logo = New-Object Windows.Controls.Image
$logo.Stretch = [Windows.Media.Stretch]::Uniform
$logo.Source = "https://www.google.com/s2/favicons?sz=64&domain_url=$([uri]::EscapeDataString($app.link))"
$logo.Add_ImageFailed({ $this.Visibility = "Collapsed"; $this.Parent.Children[0].Visibility = "Visible" })
[void]$icon.Children.Add($logo)
}
[void]$contentPanel.Children.Add($icon)
# Create the TextBlock for the application name
$appName = New-Object Windows.Controls.TextBlock
$appName.Style = $sync.Form.Resources.AppEntryNameStyle
@@ -73,7 +97,8 @@ function Initialize-InstallAppEntry {
[void]$appName.Inlines.Add($fossRun)
}
$checkBox.Content = $appName
[void]$contentPanel.Children.Add($appName)
$checkBox.Content = $contentPanel
# Add accessibility properties to make the elements screen reader friendly
$checkBox.SetValue([Windows.Automation.AutomationProperties]::NameProperty, $app.content)
@@ -34,6 +34,5 @@ function Initialize-WinUtilRunspacePool {
)
$sync.runspace.Open()
Write-WinUtilPerformanceCheckpoint -Name "Runspace pool initialized"
return $sync.runspace
}
@@ -16,28 +16,22 @@ function Initialize-WinUtilTabContent {
"Install" {
Invoke-WPFUIElements -configVariable $sync.configs.appnavigation -targetGridName "appscategory" -columncount 1
Initialize-WPFUI -targetGridName "appscategory"
Write-WinUtilPerformanceCheckpoint -Name "App navigation UI created"
Initialize-WPFUI -targetGridName "appspanel"
Write-WinUtilPerformanceCheckpoint -Name "Install UI created"
}
"Tweaks" {
Invoke-WPFUIElements -configVariable $sync.configs.tweaks -targetGridName "tweakspanel" -columncount 2
Write-WinUtilPerformanceCheckpoint -Name "Tweaks UI created"
}
"Config" {
Invoke-WPFUIElements -configVariable $sync.configs.feature -targetGridName "featurespanel" -columncount 2
Write-WinUtilPerformanceCheckpoint -Name "Features UI created"
}
"AppX" {
Invoke-WPFUIElements -configVariable $sync.configs.appx -targetGridName "appxpanel" -columncount 2
Write-WinUtilPerformanceCheckpoint -Name "AppX UI created"
}
"Win11 Creator" {
if ($sync.Form -and $sync.Form.Dispatcher) {
$sync.Form.Dispatcher.BeginInvoke([System.Windows.Threading.DispatcherPriority]::Background, [action]{ Invoke-WinUtilISOCheckExistingWork }) | Out-Null
}
Write-WinUtilPerformanceCheckpoint -Name "Win11 ISO tab initialized"
}
}
@@ -6,16 +6,13 @@ function Initialize-WinUtilTaskbarOverlayAssets {
if ($IncludeLogo -and -not $sync["logorender"]) {
$sync["logorender"] = (Invoke-WinUtilAssets -Type "Logo" -Size 90 -Render)
Write-WinUtilPerformanceCheckpoint -Name "Taskbar logo asset rendered"
}
if ($IncludeStatusAssets -and -not $sync["checkmarkrender"]) {
$sync["checkmarkrender"] = (Invoke-WinUtilAssets -Type "checkmark" -Size 512 -Render)
Write-WinUtilPerformanceCheckpoint -Name "Taskbar checkmark asset rendered"
}
if ($IncludeStatusAssets -and -not $sync["warningrender"]) {
$sync["warningrender"] = (Invoke-WinUtilAssets -Type "warning" -Size 512 -Render)
Write-WinUtilPerformanceCheckpoint -Name "Taskbar warning asset rendered"
}
}
+4 -12
View File
@@ -1,15 +1,7 @@
function Install-WinUtilChoco {
<#
.SYNOPSIS
Installs Chocolatey if it is not already installed
#>
if ((Test-WinUtilPackageManager -choco) -eq "installed") {
return
if (-not (Get-Command -Name choco)) {
Write-Host "Chocolatey is not installed. Installing now..."
$installScript = Invoke-WebRequest -Uri https://community.chocolatey.org/install.ps1 -UseBasicParsing
Invoke-Command -ScriptBlock ([scriptblock]::Create($installScript.Content))
}
Write-Host "Chocolatey is not installed. Installing now..."
Invoke-WebRequest -Uri https://community.chocolatey.org/install.ps1 -UseBasicParsing | Invoke-Expression
}
@@ -55,8 +55,6 @@ Function Invoke-WinUtilCurrentSystem {
$entry = $sync.configs.tweaks.$Config
$registryKeys = $entry.registry
$serviceKeys = $entry.service
$appxKeys = $entry.appx
$invokeScript = $entry.InvokeScript
$entryType = $entry.Type
if ($registryKeys -or $serviceKeys) {
@@ -74,6 +74,9 @@ function Invoke-WinUtilFontScaling {
}
}
# Store the scale factor so it can be reapplied after theme changes
$sync.FontScaleFactor = $ScaleFactor
# Update the font scaling percentage displayed on the UI
if ($sync.FontScalingValue) {
$percentage = [math]::Round($ScaleFactor * 100)
+17 -16
View File
@@ -1,12 +1,13 @@
function Write-Win11ISOLog {
param([string]$Message)
$ts = (Get-Date).ToString("HH:mm:ss")
$logLine = "[$ts] $Message"
$sync["WPFWin11ISOStatusLog"].Dispatcher.Invoke([action]{
$current = $sync["WPFWin11ISOStatusLog"].Text
if ($current -eq "Ready. Please select a Windows 11 ISO to begin.") {
$sync["WPFWin11ISOStatusLog"].Text = "[$ts] $Message"
$sync["WPFWin11ISOStatusLog"].Text = $logLine
} else {
$sync["WPFWin11ISOStatusLog"].Text += "`n[$ts] $Message"
$sync["WPFWin11ISOStatusLog"].Text += "`n$logLine"
}
$sync["WPFWin11ISOStatusLog"].CaretIndex = $sync["WPFWin11ISOStatusLog"].Text.Length
$sync["WPFWin11ISOStatusLog"].ScrollToEnd()
@@ -151,14 +152,9 @@ function Invoke-WinUtilISOModify {
$sync["WPFWin11ISOModifyButton"].IsEnabled = $false
$sync["Win11ISOModifying"] = $true
$existingWorkDir = Get-Item -Path (Join-Path $env:TEMP "WinUtil_Win11ISO*") |
Where-Object { $_.PSIsContainer } | Sort-Object LastWriteTime -Descending | Select-Object -First 1
$workDir = if ($existingWorkDir) {
Write-Win11ISOLog "Reusing existing temp directory: $($existingWorkDir.FullName)"
$existingWorkDir.FullName
} else {
Join-Path $env:TEMP "WinUtil_Win11ISO_$(Get-Date -Format 'yyyyMMdd_HHmmss')"
$workDir = Join-Path $env:TEMP "WinUtil_Win11ISO_$(Get-Date -Format 'yyyyMMdd_HHmmss')"
if (Test-Path $workDir) {
$workDir = Join-Path $env:TEMP "WinUtil_Win11ISO_$(Get-Date -Format 'yyyyMMdd_HHmmss')_$(([guid]::NewGuid()).ToString('N').Substring(0, 8))"
}
$autounattendContent = if ($WinUtilAutounattendXml) {
@@ -293,9 +289,11 @@ function Invoke-WinUtilISOModify {
[scriptblock]$Logger
)
$metadataLogger = $Logger
function LogMeta([string]$Message) {
if ($Logger) {
$null = $Logger.Invoke($Message)
if ($metadataLogger) {
$null = $metadataLogger.Invoke($Message)
}
}
@@ -368,8 +366,11 @@ function Invoke-WinUtilISOModify {
Log "ISO contents copied."
SetProgress "Mounting install.wim..." 25
$localWim = Join-Path $isoContents "sources\install.wim"
if (-not (Test-Path $localWim)) { $localWim = Join-Path $isoContents "sources\install.esd" }
$sourceImageFileName = Split-Path $wimPath -Leaf
$localWim = Join-Path $isoContents "sources\$sourceImageFileName"
if (-not (Test-Path $localWim)) {
throw "Copied ISO image file not found: sources\$sourceImageFileName"
}
Set-ItemProperty -Path $localWim -Name IsReadOnly -Value $false
Log "Mounting install.wim (Index ${selectedWimIndex}: $selectedEditionName) at $mountDir..."
@@ -590,10 +591,10 @@ function Invoke-WinUtilISOCleanAndReset {
}
foreach ($d in $allDirs) {
try { Remove-Item -Path $d.FullName -Force } catch {}
try { Remove-Item -Path $d.FullName -Force } catch { Log "WARNING: could not delete $($d.FullName): $_" }
}
try { Remove-Item -Path $workDir -Recurse -Force } catch {}
try { Remove-Item -Path $workDir -Recurse -Force } catch { Log "WARNING: could not delete temp directory ${workDir}: $_" }
if (Test-Path $workDir) {
Log "WARNING: some items could not be deleted in $workDir"
+71 -75
View File
@@ -70,15 +70,11 @@ function Invoke-WinUtilISOScript {
[int]$InstallImageIndex = 1,
[scriptblock]$Log = { param($m) Write-Output $m }
)
$adminSID = New-Object System.Security.Principal.SecurityIdentifier('S-1-5-32-544')
$adminGroup = $adminSID.Translate([System.Security.Principal.NTAccount])
function Set-ISOScriptReg {
param ([string]$path, [string]$name, [string]$type, [string]$value)
param ([string]$Path, [string]$Name, [string]$Type, [string]$Value)
try {
& reg add $path /v $name /t $type /d $value /f
& $Log "Set registry value: $path\$name"
& reg add $Path /v $Name /t $Type /d $Value /f
& $Log "Set registry value: $Path\$Name"
} catch {
& $Log "Error setting registry value: $_"
}
@@ -114,7 +110,7 @@ function Invoke-WinUtilISOScript {
& $Logger "boot.wim driver injection complete."
} catch {
& $Logger "Warning: boot.wim driver injection failed: $_"
try { Dismount-WindowsImage -Path $mountDir -Discard } catch {}
try { Dismount-WindowsImage -Path $mountDir -Discard } catch { & $Logger "Warning: could not discard boot.wim mount: $_" }
} finally {
Remove-Item -Path $mountDir -Recurse -Force
}
@@ -330,44 +326,44 @@ Retail
reg load HKLM\zSYSTEM "$ScratchDir\Windows\System32\config\SYSTEM"
& $Log "Bypassing system requirements..."
Set-ISOScriptReg 'HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache' 'SV1' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache' 'SV2' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache' 'SV1' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache' 'SV2' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassCPUCheck' 'REG_DWORD' '1'
Set-ISOScriptReg 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassRAMCheck' 'REG_DWORD' '1'
Set-ISOScriptReg 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassSecureBootCheck' 'REG_DWORD' '1'
Set-ISOScriptReg 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassStorageCheck' 'REG_DWORD' '1'
Set-ISOScriptReg 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassTPMCheck' 'REG_DWORD' '1'
Set-ISOScriptReg 'HKLM\zSYSTEM\Setup\MoSetup' 'AllowUpgradesWithUnsupportedTPMOrCPU' 'REG_DWORD' '1'
Set-ISOScriptReg -Path 'HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache' -Name 'SV1' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache' -Name 'SV2' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache' -Name 'SV1' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache' -Name 'SV2' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zSYSTEM\Setup\LabConfig' -Name 'BypassCPUCheck' -Type 'REG_DWORD' -Value '1'
Set-ISOScriptReg -Path 'HKLM\zSYSTEM\Setup\LabConfig' -Name 'BypassRAMCheck' -Type 'REG_DWORD' -Value '1'
Set-ISOScriptReg -Path 'HKLM\zSYSTEM\Setup\LabConfig' -Name 'BypassSecureBootCheck' -Type 'REG_DWORD' -Value '1'
Set-ISOScriptReg -Path 'HKLM\zSYSTEM\Setup\LabConfig' -Name 'BypassStorageCheck' -Type 'REG_DWORD' -Value '1'
Set-ISOScriptReg -Path 'HKLM\zSYSTEM\Setup\LabConfig' -Name 'BypassTPMCheck' -Type 'REG_DWORD' -Value '1'
Set-ISOScriptReg -Path 'HKLM\zSYSTEM\Setup\MoSetup' -Name 'AllowUpgradesWithUnsupportedTPMOrCPU' -Type 'REG_DWORD' -Value '1'
& $Log "Disabling sponsored apps..."
Set-ISOScriptReg 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'OemPreInstalledAppsEnabled' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'PreInstalledAppsEnabled' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SilentInstalledAppsEnabled' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent' 'DisableWindowsConsumerFeatures' 'REG_DWORD' '1'
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'ContentDeliveryAllowed' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zSOFTWARE\Microsoft\PolicyManager\current\device\Start' 'ConfigureStartPins' 'REG_SZ' '{"pinnedList": [{}]}'
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'FeatureManagementEnabled' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'PreInstalledAppsEverEnabled' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SoftLandingEnabled' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContentEnabled' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-310093Enabled' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-338388Enabled' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-338389Enabled' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-338393Enabled' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-353694Enabled' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-353696Enabled' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SystemPaneSuggestionsEnabled' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\PushToInstall' 'DisablePushToInstall' 'REG_DWORD' '1'
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\MRT' 'DontOfferThroughWUAU' 'REG_DWORD' '1'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' -Name 'OemPreInstalledAppsEnabled' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' -Name 'PreInstalledAppsEnabled' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' -Name 'SilentInstalledAppsEnabled' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent' -Name 'DisableWindowsConsumerFeatures' -Type 'REG_DWORD' -Value '1'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' -Name 'ContentDeliveryAllowed' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Microsoft\PolicyManager\current\device\Start' -Name 'ConfigureStartPins' -Type 'REG_SZ' -Value '{"pinnedList": [{}]}'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' -Name 'FeatureManagementEnabled' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' -Name 'PreInstalledAppsEverEnabled' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' -Name 'SoftLandingEnabled' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' -Name 'SubscribedContentEnabled' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' -Name 'SubscribedContent-310093Enabled' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' -Name 'SubscribedContent-338388Enabled' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' -Name 'SubscribedContent-338389Enabled' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' -Name 'SubscribedContent-338393Enabled' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' -Name 'SubscribedContent-353694Enabled' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' -Name 'SubscribedContent-353696Enabled' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' -Name 'SystemPaneSuggestionsEnabled' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Policies\Microsoft\PushToInstall' -Name 'DisablePushToInstall' -Type 'REG_DWORD' -Value '1'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Policies\Microsoft\MRT' -Name 'DontOfferThroughWUAU' -Type 'REG_DWORD' -Value '1'
Remove-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager\Subscriptions'
Remove-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager\SuggestedApps'
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent' 'DisableConsumerAccountStateContent' 'REG_DWORD' '1'
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent' 'DisableCloudOptimizedContent' 'REG_DWORD' '1'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent' -Name 'DisableConsumerAccountStateContent' -Type 'REG_DWORD' -Value '1'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent' -Name 'DisableCloudOptimizedContent' -Type 'REG_DWORD' -Value '1'
& $Log "Enabling local accounts on OOBE..."
Set-ISOScriptReg 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\OOBE' 'BypassNRO' 'REG_DWORD' '1'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\OOBE' -Name 'BypassNRO' -Type 'REG_DWORD' -Value '1'
if ($AutoUnattendXml) {
$preparedAutoUnattendXml = $AutoUnattendXml
@@ -423,62 +419,62 @@ Retail
}
& $Log "Disabling reserved storage..."
Set-ISOScriptReg 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager' 'ShippedWithReserves' 'REG_DWORD' '0'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager' -Name 'ShippedWithReserves' -Type 'REG_DWORD' -Value '0'
& $Log "Disabling BitLocker device encryption..."
Set-ISOScriptReg 'HKLM\zSYSTEM\ControlSet001\Control\BitLocker' 'PreventDeviceEncryption' 'REG_DWORD' '1'
Set-ISOScriptReg -Path 'HKLM\zSYSTEM\ControlSet001\Control\BitLocker' -Name 'PreventDeviceEncryption' -Type 'REG_DWORD' -Value '1'
& $Log "Disabling Chat icon..."
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\Windows Chat' 'ChatIcon' 'REG_DWORD' '3'
Set-ISOScriptReg 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced' 'TaskbarMn' 'REG_DWORD' '0'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\Windows Chat' -Name 'ChatIcon' -Type 'REG_DWORD' -Value '3'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced' -Name 'TaskbarMn' -Type 'REG_DWORD' -Value '0'
& $Log "Disabling OneDrive folder backup..."
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\OneDrive' 'DisableFileSyncNGSC' 'REG_DWORD' '1'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\OneDrive' -Name 'DisableFileSyncNGSC' -Type 'REG_DWORD' -Value '1'
& $Log "Disabling telemetry..."
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo' 'Enabled' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\Privacy' 'TailoredExperiencesWithDiagnosticDataEnabled' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy' 'HasAccepted' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Input\TIPC' 'Enabled' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\InputPersonalization' 'RestrictImplicitInkCollection' 'REG_DWORD' '1'
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\InputPersonalization' 'RestrictImplicitTextCollection' 'REG_DWORD' '1'
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\InputPersonalization\TrainedDataStore' 'HarvestContacts' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zNTUSER\Software\Microsoft\Personalization\Settings' 'AcceptedPrivacyPolicy' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\DataCollection' 'AllowTelemetry' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zSYSTEM\ControlSet001\Services\dmwappushservice' 'Start' 'REG_DWORD' '4'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo' -Name 'Enabled' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\Privacy' -Name 'TailoredExperiencesWithDiagnosticDataEnabled' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\Software\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy' -Name 'HasAccepted' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\Software\Microsoft\Input\TIPC' -Name 'Enabled' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\Software\Microsoft\InputPersonalization' -Name 'RestrictImplicitInkCollection' -Type 'REG_DWORD' -Value '1'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\Software\Microsoft\InputPersonalization' -Name 'RestrictImplicitTextCollection' -Type 'REG_DWORD' -Value '1'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\Software\Microsoft\InputPersonalization\TrainedDataStore' -Name 'HarvestContacts' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zNTUSER\Software\Microsoft\Personalization\Settings' -Name 'AcceptedPrivacyPolicy' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\DataCollection' -Name 'AllowTelemetry' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zSYSTEM\ControlSet001\Services\dmwappushservice' -Name 'Start' -Type 'REG_DWORD' -Value '4'
& $Log "Preventing installation of DevHome and Outlook..."
Set-ISOScriptReg 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler_Oobe\OutlookUpdate' 'workCompleted' 'REG_DWORD' '1'
Set-ISOScriptReg 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler\OutlookUpdate' 'workCompleted' 'REG_DWORD' '1'
Set-ISOScriptReg 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler\DevHomeUpdate' 'workCompleted' 'REG_DWORD' '1'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler_Oobe\OutlookUpdate' -Name 'workCompleted' -Type 'REG_DWORD' -Value '1'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler\OutlookUpdate' -Name 'workCompleted' -Type 'REG_DWORD' -Value '1'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler\DevHomeUpdate' -Name 'workCompleted' -Type 'REG_DWORD' -Value '1'
Remove-ISOScriptReg 'HKLM\zSOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\OutlookUpdate'
Remove-ISOScriptReg 'HKLM\zSOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\DevHomeUpdate'
& $Log "Disabling Copilot..."
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsCopilot' 'TurnOffWindowsCopilot' 'REG_DWORD' '1'
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Edge' 'HubsSidebarEnabled' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\Explorer' 'DisableSearchBoxSuggestions' 'REG_DWORD' '1'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsCopilot' -Name 'TurnOffWindowsCopilot' -Type 'REG_DWORD' -Value '1'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Policies\Microsoft\Edge' -Name 'HubsSidebarEnabled' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\Explorer' -Name 'DisableSearchBoxSuggestions' -Type 'REG_DWORD' -Value '1'
& $Log "Disabling Windows Update during OOBE (re-enabled on first logon via FirstLogon.ps1)..."
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' 'NoAutoUpdate' 'REG_DWORD' '1'
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' 'AUOptions' 'REG_DWORD' '1'
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' 'UseWUServer' 'REG_DWORD' '1'
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsUpdate' 'DisableWindowsUpdateAccess' 'REG_DWORD' '1'
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsUpdate' 'WUServer' 'REG_SZ' 'http://localhost:8080'
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsUpdate' 'WUStatusServer' 'REG_SZ' 'http://localhost:8080'
Set-ISOScriptReg 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler_Oobe\WindowsUpdate' 'workCompleted' 'REG_DWORD' '1'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' -Name 'NoAutoUpdate' -Type 'REG_DWORD' -Value '1'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' -Name 'AUOptions' -Type 'REG_DWORD' -Value '1'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' -Name 'UseWUServer' -Type 'REG_DWORD' -Value '1'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsUpdate' -Name 'DisableWindowsUpdateAccess' -Type 'REG_DWORD' -Value '1'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsUpdate' -Name 'WUServer' -Type 'REG_SZ' -Value 'http://localhost:8080'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsUpdate' -Name 'WUStatusServer' -Type 'REG_SZ' -Value 'http://localhost:8080'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler_Oobe\WindowsUpdate' -Name 'workCompleted' -Type 'REG_DWORD' -Value '1'
Remove-ISOScriptReg 'HKLM\zSOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\WindowsUpdate'
Set-ISOScriptReg 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config' 'DODownloadMode' 'REG_DWORD' '0'
Set-ISOScriptReg 'HKLM\zSYSTEM\ControlSet001\Services\BITS' 'Start' 'REG_DWORD' '4'
Set-ISOScriptReg 'HKLM\zSYSTEM\ControlSet001\Services\wuauserv' 'Start' 'REG_DWORD' '4'
Set-ISOScriptReg 'HKLM\zSYSTEM\ControlSet001\Services\UsoSvc' 'Start' 'REG_DWORD' '4'
Set-ISOScriptReg 'HKLM\zSYSTEM\ControlSet001\Services\WaaSMedicSvc' 'Start' 'REG_DWORD' '4'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config' -Name 'DODownloadMode' -Type 'REG_DWORD' -Value '0'
Set-ISOScriptReg -Path 'HKLM\zSYSTEM\ControlSet001\Services\BITS' -Name 'Start' -Type 'REG_DWORD' -Value '4'
Set-ISOScriptReg -Path 'HKLM\zSYSTEM\ControlSet001\Services\wuauserv' -Name 'Start' -Type 'REG_DWORD' -Value '4'
Set-ISOScriptReg -Path 'HKLM\zSYSTEM\ControlSet001\Services\UsoSvc' -Name 'Start' -Type 'REG_DWORD' -Value '4'
Set-ISOScriptReg -Path 'HKLM\zSYSTEM\ControlSet001\Services\WaaSMedicSvc' -Name 'Start' -Type 'REG_DWORD' -Value '4'
& $Log "Preventing installation of Teams..."
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Teams' 'DisableInstallation' 'REG_DWORD' '1'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Policies\Microsoft\Teams' -Name 'DisableInstallation' -Type 'REG_DWORD' -Value '1'
& $Log "Preventing installation of new Outlook..."
Set-ISOScriptReg 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\Windows Mail' 'PreventRun' 'REG_DWORD' '1'
Set-ISOScriptReg -Path 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\Windows Mail' -Name 'PreventRun' -Type 'REG_DWORD' -Value '1'
& $Log "Unloading offline registry hives..."
reg unload HKLM\zCOMPONENTS
+1 -1
View File
@@ -180,7 +180,7 @@ function Invoke-WinUtilISOWriteUSB {
Start-Sleep -Seconds 2
Update-Disk -Number $diskNum
try { Remove-PartitionAccessPath -DiskNumber $diskNum -PartitionNumber $winpePart.PartitionNumber -AccessPath "$($winpePart.DriveLetter):" } catch {}
try { Remove-PartitionAccessPath -DiskNumber $diskNum -PartitionNumber $winpePart.PartitionNumber -AccessPath "$($winpePart.DriveLetter):" } catch { Log "Warning: could not remove existing partition access path: $_" }
$usbLetter = Get-FreeDriveLetter
if (-not $usbLetter) { throw "No free drive letters (D-Z) available to assign to the USB data partition." }
Set-Partition -DiskNumber $diskNum -PartitionNumber $winpePart.PartitionNumber -NewDriveLetter $usbLetter
@@ -8,7 +8,7 @@ function Invoke-WinUtilInstallPSProfile {
if (-not (Get-Command pwsh)) {
Write-Host "PowerShell 7 not found. Installing..."
Install-WinUtilWinget
winget install Microsoft.PowerShell --source winget --silent
winget install Microsoft.PowerShell --source winget --installer-type wix --silent
}
wt new-tab pwsh -NoExit -Command "irm https://github.com/ChrisTitusTech/powershell-profile/raw/main/setup.ps1 | iex"
+1 -1
View File
@@ -1,4 +1,4 @@
Function Invoke-WinUtilSponsors {
$sponsors = ([regex]::Matches(([regex]::Match((irm https://github.com/sponsors/ChrisTitusTech),'(?s)(?<=Current sponsors).*?(?=Past sponsors)')).Value,'(?<=alt="@)[^"]+')).Value | Where-Object {$_ -ne "ChrisTitusTech"}
$sponsors = ([regex]::Matches(([regex]::Match((Invoke-RestMethod https://github.com/sponsors/ChrisTitusTech),'(?s)(?<=Current sponsors).*?(?=Past sponsors)')).Value,'(?<=alt="@)[^"]+')).Value | Where-Object {$_ -ne "ChrisTitusTech"}
return $sponsors
}
@@ -78,6 +78,7 @@ function Invoke-WinUtilTweaks {
$sync.configs.tweaks.$CheckBox.appx | ForEach-Object {
Remove-WinUtilAPPX -Name $psitem
}
Remove-WinUtilProvisionedAPPX -PackageList $sync.configs.tweaks.$CheckBox.appx
}
}
Write-WinUtilLog -Component "Tweaks" -Message "$action tweak completed: $CheckBox"
+19 -15
View File
@@ -91,40 +91,39 @@ function Invoke-WinutilThemeChange {
# Retrieve all theme properties from the theme configuration
$themeProperties = $sync.configs.themes.$currentTheme.PSObject.Properties
foreach ($_ in $themeProperties) {
foreach ($themeProperty in $themeProperties) {
# Apply properties that deal with colors
if ($_.Name -like "*color*") {
Set-ThemeResourceProperty -Name $_.Name -Value $_.Value -Type "ColorBrush"
if ($themeProperty.Name -like "*color*") {
Set-ThemeResourceProperty -Name $themeProperty.Name -Value $themeProperty.Value -Type "ColorBrush"
# For certain color properties, also set complementary values (e.g., BorderColor -> CBorderColor) This is required because e.g DropShadowEffect requires a <Color> and not a <SolidColorBrush> object
if ($_.Name -in @("BorderColor", "ButtonBackgroundMouseoverColor")) {
Set-ThemeResourceProperty -Name "C$($_.Name)" -Value $_.Value -Type "Color"
if ($themeProperty.Name -in @("BorderColor", "ButtonBackgroundMouseoverColor")) {
Set-ThemeResourceProperty -Name "C$($themeProperty.Name)" -Value $themeProperty.Value -Type "Color"
}
}
# Apply corner radius properties
elseif ($_.Name -like "*Radius*") {
Set-ThemeResourceProperty -Name $_.Name -Value $_.Value -Type "CornerRadius"
elseif ($themeProperty.Name -like "*Radius*") {
Set-ThemeResourceProperty -Name $themeProperty.Name -Value $themeProperty.Value -Type "CornerRadius"
}
# Apply row height properties
elseif ($_.Name -like "*RowHeight*") {
Set-ThemeResourceProperty -Name $_.Name -Value $_.Value -Type "GridLength"
elseif ($themeProperty.Name -like "*RowHeight*") {
Set-ThemeResourceProperty -Name $themeProperty.Name -Value $themeProperty.Value -Type "GridLength"
}
# Apply thickness or margin properties
elseif (($_.Name -like "*Thickness*") -or ($_.Name -like "*margin")) {
Set-ThemeResourceProperty -Name $_.Name -Value $_.Value -Type "Thickness"
elseif (($themeProperty.Name -like "*Thickness*") -or ($themeProperty.Name -like "*margin")) {
Set-ThemeResourceProperty -Name $themeProperty.Name -Value $themeProperty.Value -Type "Thickness"
}
# Apply font family properties
elseif ($_.Name -like "*FontFamily*") {
Set-ThemeResourceProperty -Name $_.Name -Value $_.Value -Type "FontFamily"
elseif ($themeProperty.Name -like "*FontFamily*") {
Set-ThemeResourceProperty -Name $themeProperty.Name -Value $themeProperty.Value -Type "FontFamily"
}
# Apply any other properties as doubles (numerical values)
else {
Set-ThemeResourceProperty -Name $_.Name -Value $_.Value -Type "Double"
Set-ThemeResourceProperty -Name $themeProperty.Name -Value $themeProperty.Value -Type "Double"
}
}
}
$sync.preferences.theme = $theme
Set-Preferences -save
Set-WinutilTheme -currentTheme "shared"
switch ($sync.preferences.theme) {
@@ -150,6 +149,11 @@ function Invoke-WinutilThemeChange {
}
}
# Reapply font scaling if it was previously set (theme change resets shared resources)
if ($sync.ContainsKey("FontScaleFactor") -and $sync.FontScaleFactor -ne 1.0) {
Invoke-WinUtilFontScaling -ScaleFactor $sync.FontScaleFactor
}
# Update the theme selector button with the appropriate icon
$ThemeButton = $sync.Form.FindName("ThemeButton")
$ThemeButton.Content = [string]$themeButtonIcon
+15 -2
View File
@@ -17,7 +17,20 @@ function Remove-WinUtilAPPX {
Write-Host "Removing $Name"
Write-WinUtilLog -Component "AppX" -Message "Removing AppX package pattern: $Name"
Get-AppxPackage $Name -AllUsers | Remove-AppxPackage -AllUsers
Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $Name | Remove-AppxProvisionedPackage -Online
# We explicitly loop through packages instead of using the pipeline because PowerShell 7 pipeline binding
# for Remove-AppxPackage fails silently, and Get-AppxPackage -AllUsers returns duplicate objects for each user profile.
$pkgs = Get-AppxPackage "*$Name*" -AllUsers | Sort-Object -Property PackageFullName -Unique
if ($null -ne $pkgs) {
foreach ($pkg in $pkgs) {
try {
Remove-AppxPackage -Package $pkg.PackageFullName -AllUsers -ErrorAction Stop
}
catch {
Write-WinUtilLog -Level "ERROR" -Component "AppX" -Message "Failed to remove AppX package $($pkg.PackageFullName): $($_.Exception.Message)"
}
}
}
Write-WinUtilLog -Component "AppX" -Message "AppX removal completed for package pattern: $Name"
}
@@ -0,0 +1,61 @@
function Remove-WinUtilProvisionedAPPX {
<#
.SYNOPSIS
Removes all AppX provisioned packages that match the given names
.PARAMETER PackageList
An array of names of the APPX packages to remove
.EXAMPLE
Remove-WinUtilProvisionedAPPX -PackageList @("Microsoft.Microsoft3DViewer", "Microsoft.WindowsCalculator")
#>
param (
[string[]]$PackageList
)
if ($null -eq $PackageList -or $PackageList.Count -eq 0) {
return
}
Write-Host "`nRemoving provisioned packages..."
Write-WinUtilLog -Component "AppX" -Message "Removing AppX provisioned packages: $($PackageList -join ', ')"
# DISM cmdlets like Get-AppxProvisionedPackage often fail with "Class not registered" or hang in PowerShell 7.
# We shell out to Windows PowerShell 5.1 (powershell.exe) to reliably remove the provisioned packages.
$ps5Command = {
$pkgs = $args
$provisionedPackages = Get-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
$failures = [System.Collections.Generic.List[string]]::new()
foreach ($Package in $pkgs) {
$provs = $provisionedPackages |
Where-Object DisplayName -Like "*$Package*"
if ($null -ne $provs) {
foreach ($prov in $provs) {
try {
Remove-AppxProvisionedPackage -Online -PackageName $prov.PackageName -ErrorAction Stop | Out-Null
}
catch {
$failures.Add("Failed to remove provisioned AppX package $($prov.PackageName): $($_.Exception.Message)")
}
}
}
}
if ($failures.Count -gt 0) {
throw ($failures -join [Environment]::NewLine)
}
}
$removalOutput = powershell.exe -NoProfile -NonInteractive -Command $ps5Command -args $PackageList 2>&1
if ($LASTEXITCODE -ne 0 -or $null -ne $removalOutput) {
$failureDetails = ($removalOutput | Out-String).Trim()
Write-WinUtilLog -Level "ERROR" -Component "AppX" -Message "AppX provisioned package removal failed: $failureDetails"
return
}
Write-WinUtilLog -Component "AppX" -Message "AppX provisioned package removal completed."
}
+5 -1
View File
@@ -22,7 +22,11 @@ function Reset-WPFCheckBoxes {
)
$CheckBoxesToCheck = $sync.selectedApps + $sync.selectedTweaks + $sync.selectedFeatures + $sync.selectedAppx
$CheckBoxes = ($sync.GetEnumerator()).where{ $_.Value -is [System.Windows.Controls.CheckBox] -and $_.Name -notlike "WPFToggle*" -and $_.Name -like "$checkboxfilterpattern"}
$CheckBoxes = foreach ($syncEntry in $sync.GetEnumerator()) {
if ($syncEntry.Value -is [System.Windows.Controls.CheckBox] -and $syncEntry.Name -notlike "WPFToggle*" -and $syncEntry.Name -like $checkboxfilterpattern) {
$syncEntry
}
}
foreach ($CheckBox in $CheckBoxes) {
$checkboxName = $CheckBox.Key
-81
View File
@@ -1,81 +0,0 @@
function Set-Preferences{
param(
[switch]$save=$false
)
# TODO delete this function sometime later
function Clean-OldPrefs{
if (Test-Path -Path "$winutildir\LightTheme.ini") {
$sync.preferences.theme = "Light"
Remove-Item -Path "$winutildir\LightTheme.ini"
}
if (Test-Path -Path "$winutildir\DarkTheme.ini") {
$sync.preferences.theme = "Dark"
Remove-Item -Path "$winutildir\DarkTheme.ini"
}
# check old prefs, if its first line has no =, then absorb it as pm
if (Test-Path -Path $iniPath) {
$oldPM = Get-Content $iniPath
if ($oldPM -notlike "*=*") {
$sync.preferences.packagemanager = $oldPM
}
}
if (Test-Path -Path "$winutildir\preferChocolatey.ini") {
$sync.preferences.packagemanager = "Choco"
Remove-Item -Path "$winutildir\preferChocolatey.ini"
}
}
function Save-Preferences{
$ini = ""
foreach($key in $sync.preferences.Keys) {
$pref = "$($key)=$($sync.preferences.$key)"
$ini = $ini + $pref + "`r`n"
}
$ini | Out-File $iniPath
}
function Load-Preferences{
Clean-OldPrefs
if (Test-Path -Path $iniPath) {
$iniData = Get-Content "$winutildir\preferences.ini"
foreach ($line in $iniData) {
if ($line -like "*=*") {
$arr = $line -split "=",-2
$key = $arr[0] -replace "\s",""
$value = $arr[1] -replace "\s",""
$sync.preferences.$key = $value
}
}
}
# write defaults in case preferences dont exist
if ($null -eq $sync.preferences.theme) {
$sync.preferences.theme = "Auto"
}
if ($null -eq $sync.preferences.packagemanager) {
$sync.preferences.packagemanager = "Winget"
}
# convert packagemanager to enum
if ($sync.preferences.packagemanager -eq "Choco") {
$sync.preferences.packagemanager = [PackageManagers]::Choco
}
elseif ($sync.preferences.packagemanager -eq "Winget") {
$sync.preferences.packagemanager = [PackageManagers]::Winget
}
}
$iniPath = "$winutildir\preferences.ini"
if ($save) {
Save-Preferences
}
else {
Load-Preferences
}
}
+17 -4
View File
@@ -12,25 +12,38 @@ function Set-WinUtilDNS {
#>
param($DNSProvider)
if($DNSProvider -eq "Default") {
Write-WinUtilLog -Component "DNS" -Message "DNS provider is Default; no DNS changes applied."
return
}
try {
$Adapters = Get-NetAdapter | Where-Object {$_.Status -eq "Up"}
Write-Host "Ensuring DNS is set to $DNSProvider on the following interfaces:"
Write-Host $($Adapters | Out-String)
Write-WinUtilLog -Component "DNS" -Message "Setting DNS provider to $DNSProvider for $(@($Adapters).Count) active adapter(s)."
if($DNSProvider -ne "DHCP") {
$dns = $sync.configs.dns.$DNSProvider
if($null -eq $dns) {
Write-Warning "DNS provider $DNSProvider was not found in configuration."
Write-WinUtilLog -Level "ERROR" -Component "DNS" -Message "DNS provider $DNSProvider was not found in configuration."
return
}
}
Foreach ($Adapter in $Adapters) {
if($DNSProvider -eq "DHCP") {
Write-WinUtilLog -Component "DNS" -Message "Resetting DNS to DHCP on adapter $($Adapter.Name) (ifIndex: $($Adapter.ifIndex))."
Set-DnsClientServerAddress -InterfaceIndex $Adapter.ifIndex -ResetServerAddresses
netsh interface ip set dnsservers name="$($Adapter.Name)" source=dhcp
netsh interface ipv6 set dnsservers name="$($Adapter.Name)" source=dhcp
} else {
Write-WinUtilLog -Component "DNS" -Message "Setting IPv4 DNS on adapter $($Adapter.Name) (ifIndex: $($Adapter.ifIndex)) to $($sync.configs.dns.$DNSProvider.Primary), $($sync.configs.dns.$DNSProvider.Secondary)."
Set-DnsClientServerAddress -InterfaceIndex $Adapter.ifIndex -ServerAddresses ("$($sync.configs.dns.$DNSProvider.Primary)", "$($sync.configs.dns.$DNSProvider.Secondary)")
Write-WinUtilLog -Component "DNS" -Message "Setting IPv6 DNS on adapter $($Adapter.Name) (ifIndex: $($Adapter.ifIndex)) to $($sync.configs.dns.$DNSProvider.Primary6), $($sync.configs.dns.$DNSProvider.Secondary6)."
Set-DnsClientServerAddress -InterfaceIndex $Adapter.ifIndex -ServerAddresses ("$($sync.configs.dns.$DNSProvider.Primary6)", "$($sync.configs.dns.$DNSProvider.Secondary6)")
Write-WinUtilLog -Component "DNS" -Message "Setting IPv4 DNS on adapter $($Adapter.Name) (ifIndex: $($Adapter.ifIndex)) to $($dns.Primary), $($dns.Secondary)."
Set-DnsClientServerAddress -InterfaceIndex $Adapter.ifIndex -ServerAddresses ($dns.Primary, $dns.Secondary)
Write-WinUtilLog -Component "DNS" -Message "Setting IPv6 DNS on adapter $($Adapter.Name) (ifIndex: $($Adapter.ifIndex)) to $($dns.Primary6), $($dns.Secondary6)."
Set-DnsClientServerAddress -InterfaceIndex $Adapter.ifIndex -ServerAddresses ($dns.Primary6, $dns.Secondary6)
}
}
Write-WinUtilLog -Component "DNS" -Message "DNS provider change completed: $DNSProvider"
+7 -5
View File
@@ -14,11 +14,13 @@ function Set-WinUtilProgressbar{
[int]$Percent
)
Invoke-WPFUIThread -ScriptBlock {$sync.progressBarTextBlock.Text = $label}
Invoke-WPFUIThread -ScriptBlock {$sync.progressBarTextBlock.ToolTip = $label}
if ($percent -lt 5 ) {
$percent = 5 # Ensure the progress bar is not empty, as it looks weird
$progressLabel = $Label
Invoke-WPFUIThread -ScriptBlock {$sync.progressBarTextBlock.Text = $progressLabel}
Invoke-WPFUIThread -ScriptBlock {$sync.progressBarTextBlock.ToolTip = $progressLabel}
if ($Percent -lt 5 ) {
$Percent = 5 # Ensure the progress bar is not empty, as it looks weird
}
Invoke-WPFUIThread -ScriptBlock { $sync.ProgressBar.Value = $percent}
Invoke-WPFUIThread -ScriptBlock { $sync.ProgressBar.Value = $Percent}
}
+14 -10
View File
@@ -193,6 +193,7 @@ function Show-CustomDialog {
# Define the Regex to find hyperlinks formatted as HTML <a> tags
$regex = [regex]::new('<a href="([^"]+)">([^<]+)</a>')
$lastPos = 0
$linkHoverBrush = $LinkHoverForegroundColor
# Iterate through each match and add regular text and hyperlinks
foreach ($match in $regex.Matches($Message)) {
@@ -210,20 +211,23 @@ function Show-CustomDialog {
$hyperlink.Foreground = $LinkForegroundColor
$hyperlink.Add_Click({
param($sender, $args)
Start-Process $sender.NavigateUri.AbsoluteUri
param($eventSender, $routedEvent)
$null = $routedEvent
Start-Process $eventSender.NavigateUri.AbsoluteUri
})
$hyperlink.Add_MouseEnter({
param($sender, $args)
$sender.Foreground = $LinkHoverForegroundColor
$sender.FontSize = ($FontSize + ($FontSize / 4))
$sender.FontWeight = "SemiBold"
param($eventSender, $routedEvent)
$null = $routedEvent
$eventSender.Foreground = $linkHoverBrush
$eventSender.FontSize = ($FontSize + ($FontSize / 4))
$eventSender.FontWeight = "SemiBold"
})
$hyperlink.Add_MouseLeave({
param($sender, $args)
$sender.Foreground = $LinkForegroundColor
$sender.FontSize = $FontSize
$sender.FontWeight = "Normal"
param($eventSender, $routedEvent)
$null = $routedEvent
$eventSender.Foreground = $LinkForegroundColor
$eventSender.FontSize = $FontSize
$eventSender.FontWeight = "Normal"
})
$messageTextBlock.Inlines.Add($hyperlink)
+3 -1
View File
@@ -10,11 +10,13 @@ function Show-WPFInstallAppBusy {
param (
$text = "Installing apps..."
)
$overlayText = $text
Invoke-WPFUIThread -ScriptBlock {
$sync.InstallAppAreaOverlay.Visibility = [Windows.Visibility]::Visible
$sync.InstallAppAreaOverlay.Width = $($sync.InstallAppAreaScrollViewer.ActualWidth * 0.4)
$sync.InstallAppAreaOverlay.Height = $($sync.InstallAppAreaScrollViewer.ActualWidth * 0.4)
$sync.InstallAppAreaOverlayText.Text = $text
$sync.InstallAppAreaOverlayText.Text = $overlayText
$sync.InstallAppAreaBorder.IsEnabled = $false
$sync.InstallAppAreaScrollViewer.Effect.Radius = 5
}

Some files were not shown because too many files have changed in this diff Show More