Verify WinGet config exists before invoking winget configure#40496
Merged
benhillis merged 2 commits intoMay 11, 2026
Merged
Conversation
If the resolved `` does not exist, `winget configure` fails with a cryptic error rather than telling the user that the config file is missing. Add an explicit `Test-Path` guard that reports the missing file path and the expected location, and update the existing failure message to print the full `` instead of just `` so it matches the path actually passed to `winget configure`. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
5 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Improves the developer environment setup script by validating the WinGet configuration file path before running winget configure, and by making failure output reference the full path passed to WinGet.
Changes:
- Add a
Test-Pathguard to fail fast with a clear message when the config file is missing. - Update the
winget configurefailure message to include$configPathinstead of just the filename.
OneBlue
approved these changes
May 11, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Split out from #40489.
If the resolved
does not exist (e.g. the repo wasn't fully checked out, or the .config folder is missing the file), `winget configure` fails with a cryptic error instead of pointing at the missing file. The existing error message after a failed `winget configure` also prints just(the bare name), not the full path actually passed to winget.Changes (
tools/setup-dev-env.ps1)Test-Pathguard on `` after it's resolved, exiting with a clear message if the file is missing.winget configurefailure message to printinstead of.