Skip to content

Verify WinGet config exists before invoking winget configure#40496

Merged
benhillis merged 2 commits into
microsoft:masterfrom
benhillis:user/benhill/fix-setup-dev-env-config-guard
May 11, 2026
Merged

Verify WinGet config exists before invoking winget configure#40496
benhillis merged 2 commits into
microsoft:masterfrom
benhillis:user/benhill/fix-setup-dev-env-config-guard

Conversation

@benhillis
Copy link
Copy Markdown
Member

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)

  • Add a Test-Path guard on `` after it's resolved, exiting with a clear message if the file is missing.
  • Update the post-winget configure failure message to print instead of.

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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-Path guard to fail fast with a clear message when the config file is missing.
  • Update the winget configure failure message to include $configPath instead of just the filename.

Comment thread tools/setup-dev-env.ps1
@benhillis benhillis marked this pull request as ready for review May 11, 2026 17:49
@benhillis benhillis requested a review from a team as a code owner May 11, 2026 17:49
@benhillis benhillis enabled auto-merge (squash) May 11, 2026 19:46
@benhillis benhillis merged commit 9131794 into microsoft:master May 11, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants