Skip to content

Exclude .vsidx files from clean to avoid git prompts during build - #27758

Closed
Guillermo López-Anglada (guillermooo) wants to merge 2 commits into
PowerShell:masterfrom
guillermooo:users/guillermooo/bugfix/ignore-vsidx-files-during-build-clean
Closed

Exclude .vsidx files from clean to avoid git prompts during build#27758
Guillermo López-Anglada (guillermooo) wants to merge 2 commits into
PowerShell:masterfrom
guillermooo:users/guillermooo/bugfix/ignore-vsidx-files-during-build-clean

Conversation

@guillermooo

@guillermooo Guillermo López-Anglada (guillermooo) commented Aug 4, 2026

Copy link
Copy Markdown

Closes #27745

PR Summary

Ignore .vsidx files during clean to avoid git prompts if the files are locked by Visual Studio.

PR Context

See #27745

PR Checklist

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@guillermooo
Guillermo López-Anglada (guillermooo) marked this pull request as ready for review August 4, 2026 05:03
Copilot AI lite review requested due to automatic review settings August 4, 2026 05:03
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates Start-PSBuild -Clean in build.psm1 to avoid interactive git clean prompts when Visual Studio has .vsidx files locked, by excluding those files from the clean operation.

Changes:

  • Add an exclusion for .vs/**/*.vsidx during Start-PSBuild -Clean.
  • Reformat the git clean invocation into a multi-line command with explicit excludes.
  • Adjust git clean flags (currently changes behavior from -fdX to -dx --force).

Comment thread build.psm1 Outdated
Comment thread build.psm1
Comment on lines +499 to +503
git clean -dX --force `
--exclude .vs/**/*.vsidx `
--exclude src/Modules/nuget.config `
--exclude .vs/PowerShell/v16/Server/sqlite3 `
--exclude nuget.config

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We strongly discourage use of backticks (even though they are supported) because they are hard to see & have caused plenty of issues in the past

please update this to using splatting
(although this doc needs updating to add splatting to Native Executables & an issue for that has been raised)

Suggested change
git clean -dX --force `
--exclude .vs/**/*.vsidx `
--exclude src/Modules/nuget.config `
--exclude .vs/PowerShell/v16/Server/sqlite3 `
--exclude nuget.config
$gitArgs = @(
'clean'
'-dX'
'--force'
'--exclude=.vs/**/*.vsidx'
'--exclude=src/Modules/nuget.config'
'--exclude=.vs/PowerShell/v16/Server/sqlite3'
'--exclude=nuget.config'
)
git --% @gitArgs

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

you should double check that suggestion is right as I asked copliot.microsoft.com to give them to me & like all AI's they can be wrong from time to time

@kilasuit Ryan Yates (kilasuit) added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Aug 4, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added Backport-7.4.x-Consider Backport-7.5.x-Consider Backport-7.6.x-Consider Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept labels Aug 4, 2026
@guillermooo

Copy link
Copy Markdown
Author

Ryan Yates (@kilasuit) Never mind. The fix doesn't really work. git will still prompt if a .vsidx file is locked. It seems a bit random and sometimes appears to work, but not a definite fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport-7.4.x-Consider Backport-7.5.x-Consider Backport-7.6.x-Consider CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build.psm1 :: Start-PSBuild: Bad interaction between CLI and Visual Studio

3 participants