[pull] main from ChrisTitusTech:main - #218
Merged
Merged
Conversation
…ript (#5086) Invoke-WinUtilISOScript.ps1's PostInstall script set DisableFileSyncNGSC to 1, which FirstLogon.ps1 (from #4409) then immediately overrides back to 0. The final value was correct, but only because one script undoes the other's write on every install. Removes the redundant PostInstall write so FirstLogon.ps1's existing 0 assignment is the only place setting this value. Verified the script still parses correctly after the change.
…5090) * Warn instead of logging tweak completed after a step error Invoke-WinUtilTweaks wrote "Apply tweak completed" unconditionally, even when Invoke-WinUtilScript or another helper had just logged an ERROR for that tweak. The job layer already counts those errors, so snapshot the count after the header line and compare at the end: log a WARN line with the error count when it grew, otherwise the existing completed line. Two Pester cases run the real logger and script runner against a temp log file to pin both outcomes. * Count tweak step errors from the shared log list The job error counter only increments inside a Start-WinUtilJob worker. Toggle switches call Invoke-WinUtilTweaks directly on the UI thread, so a failing toggle still logged "tweak completed" after its ERROR line. Every ERROR line is added to $sync.LoggedErrors from any runspace, and Invoke-WinUtilAutoRun already reads it as a before/after delta, so the tweak runner now does the same. The completion-status tests run without the worker flag and seed an earlier unrelated error, and a new case covers a failing UndoScript. * Count tweak errors on the logging runspace, not the shared list Diffing $sync.LoggedErrors charged a toggle with errors a concurrent job logged from its own runspace. Global scope is per runspace, so the logger now bumps the runspace counter for every headline error and the tweak status diffs that. Job workers still reset the counter at start and end, so job results are unchanged.
- Update driver injection checkbox tooltip to describe individual package injection instead of a single DISM pass - Make modification working label conditional so it displays 'Preparing setup media' when driver injection is disabled - Update documentation screenshot to show the current 3-step wizard layout and vertical status log
* Add friendly explanations for common DISM exit codes Invoke-WinUtilISODism threw only a raw exit code on DISM failure (e.g. "DISM add-driver failed with exit code 112"), leaving users to look up what the number means themselves. Adds a $knownExitCode lookup table mapping common Windows/DISM exit codes (disk full, access denied, file/path not found, file in use, timeout, etc.) to plain-English explanations. When a failure's exit code is recognized, the thrown message now includes the explanation in parentheses; unrecognized codes fall back to the original plain-number message. Verified the script still parses correctly after the change. * Add missing period to fallback DISM error message * Add tests for DISM known/unknown exit code error messages Adds a test verifying a known exit code (112) produces the friendly explanation in the thrown message, alongside the existing test verifying an unrecognized code still falls back to the plain numeric message. Verified: all 35 tests in win11creator.Tests.ps1 pass. * Document DISM friendly error messages in Win11 Creator troubleshooting Adds a Troubleshooting table row explaining the new DISM error message format (exit code + explanation in parentheses), with guidance for the most common cases and a link to Microsoft's full error code reference for anything not explained. * Fix duplicate DISM calls in unmapped exit code test The unmapped-code test called Invoke-WinUtilISOScript twice — once via Should -Throw, once to capture the message for the no-parens check — causing $script:dismCalls to double-count. Consolidated to a single call, checking both the exit code and the absence of a parenthesized explanation against one captured exception message. Verified: all 36 tests in win11creator.Tests.ps1 pass. * Fix broken DISM error code reference link in docs Replaced the dead windows-hardware/manufacture link with Microsoft's actual System Error Codes reference page, which DISM exit codes correspond to. * Strengthen DISM fallback regression coverage --------- Co-authored-by: Chris Titus <contact@christitus.com>
* fix(windows update): prevent sudden restart Microsoft has documented that the `NoAutoRebootWithLoggedOnUsers` registry key is unreliable and does not work as described in newer versions of Windows. To effectively prevent unexpected restarts in modern configurations, this PR updates the `Recommended` settings workflow on the `Updates` tab. Changes - Modify `AUOptions` to 3: automatic download and manual installation. - Remove the obsolete registry key. - Keep the removal of the registry key in functions that reset Windows Update to default. - Update UI text and documentation. - Update Pester tests. Microsoft documentation: https://learn.microsoft.com/en-us/windows/deployment/update/waas-restart Resolves #5093 * Clarify update installation notification behavior --------- Co-authored-by: Chris Titus <contact@christitus.com>
* style(ui): replace 'Get' with 'Select' To a programmer, 'Get' means read the current state. To a lay user, 'Get' means obtain or download (like the 'Get' button in the Microsoft Store). 'Select' indicates exactly what it does and maintains parallelism with 'Select All'. * docs: align installed tweak references with selection labels --------- Co-authored-by: Chris Titus <contact@christitus.com>
* style(ui): clarify scope in the note - clarify which command affects only the current user and which affects all users - replace StackPanel with WrapPanel to prevent text clipping at 200% font scaling * fix(ui): scope AppX installation note to local registration --------- Co-authored-by: Chris Titus <contact@christitus.com>
* Fix WaaSMedicSvc restoration using direct registry write Set-Service fails on WaaSMedicSvc with Access Denied since it's a protected service (LaunchProtected=2). FirstLogon.ps1 silently swallowed this failure via -ErrorAction SilentlyContinue, permanently leaving WaaSMedicSvc disabled after setup. Removes WaaSMedicSvc from the Set-Service restoration loop and restores it via a direct registry write instead, matching the same technique already used to disable it in WinUtil-PostInstall.ps1. Added a test verifying the old Set-Service-based restoration is gone and the new registry-write fix is present. Addresses the WaaSMedicSvc portion of #5095; the broader AppX/Store failure investigation is out of scope for this change. * Assert exact registry-write contract for WaaSMedicSvc test Per CodeRabbit review: the previous assertion only checked that Set-ItemProperty and WaaSMedicSvc appeared near each other, which would pass even with a wrong -Value or -Type. Now asserts the complete command including -Value 3 and -Type DWord. * Surface service restoration failures in FirstLogon.log BITS, wuauserv, UsoSvc, and WaaSMedicSvc restoration all used -ErrorAction SilentlyContinue, which suppresses errors before they reach the output stream FirstLogon.ps1 redirects to its log file (*>&1 ... >> FirstLogon.log). This meant any restoration failure — not just the WaaSMedicSvc one already fixed — was invisible even in the log. Changed -ErrorAction SilentlyContinue to Continue on both the Set-Service loop and the WaaSMedicSvc registry write, so failures still don't halt the script but now actually land in FirstLogon.log for troubleshooting. Addresses the logging portion of the reporter's suggestion in #5095. * Assert -ErrorAction Continue in WaaSMedicSvc test Per CodeRabbit review: the existing test only checked the Set-ItemProperty command and value, not the -ErrorAction Continue change made for logging. Extended the same test to also assert both the Set-ItemProperty and Set-Service lines use Continue instead of SilentlyContinue. * Extend WaaSMedicSvc test to cover full ErrorAction Continue Per CodeRabbit review: the registry-write assertion stopped at -Type DWord, so a regression back to -ErrorAction SilentlyContinue would still pass. Extended the pattern to include -ErrorAction Continue at the end of the command. * Exercise FirstLogon service restoration behavior --------- Co-authored-by: Chris Titus <contact@christitus.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )