Skip to content

Use -NoProfile to avoid interference from user's profile when invoking TrimDocs.ps1 - #4702

Open
sharpjs wants to merge 1 commit into
dotnet:mainfrom
sharpjs:dev/sharpjs/trimdocs-noprofile
Open

sharpjs wants to merge 1 commit into
dotnet:mainfrom
sharpjs:dev/sharpjs/trimdocs-noprofile

Conversation

@sharpjs

@sharpjs sharpjs commented Sep 16, 2026

Copy link
Copy Markdown

Description

This PR adds the -NoProfile switch when invoking tools/intellisense/TrimDocs.ps1 via pwsh.

This flag prevents the developer's profile from interfering with the invocation — for example, by changing the current directory to something unexpected.

Issues

Fixes #4701 .

Testing

No behavior or API change. This PR is testable by dotnet build itself.

# Optionally, poison the PowerShell profile
Add-Content $PROFILE.CurrentUserAllHosts "Set-Location C:\"

dotnet build

The build should succeed.

Copilot AI balanced review requested due to automatic review settings September 16, 2026 17:18
@sharpjs
sharpjs requested a review from a team as a code owner September 16, 2026 17:18
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Sep 16, 2026
@azure-pipelines

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

@sharpjs

sharpjs commented Sep 16, 2026

Copy link
Copy Markdown
Author

suggested labels: Area\Engineering

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.

🟢 Approval recommended

The focused change correctly prevents profile-driven working-directory changes without affecting build behavior.

Pull request overview

Adds -NoProfile to prevent developer PowerShell profiles from interfering with documentation trimming during builds.

Changes:

  • Runs TrimDocs.ps1 without loading PowerShell profiles.
  • Resolves the build failure described in #4701.
File summaries
File Description
src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.csproj Adds -NoProfile to the PowerShell invocation.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@sharpjs sharpjs changed the title Use -NoProfile to avoid interference from user's profile. Use -NoProfile to avoid interference from user's profile when invoking TrimDocs.ps1 Sep 18, 2026
@mdaigle mdaigle added this to the 8.0.0-preview1 milestone Sep 18, 2026

This branch has not been deployed

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

Labels

None yet

Projects

Status: To triage

Development

Successfully merging this pull request may close these issues.

Build fails if developer's PowerShell profile sets the current directory

5 participants