Skip to content

Update Install-Dotnet to directly run the install script - #28022

Merged
Dongbo Wang (daxian-dbw) merged 1 commit into
PowerShell:masterfrom
daxian-dbw:dotnet-install-ps1
Sep 17, 2026
Merged

Dongbo Wang (daxian-dbw) merged 1 commit into
PowerShell:masterfrom
daxian-dbw:dotnet-install-ps1

Conversation

@daxian-dbw

@daxian-dbw Dongbo Wang (daxian-dbw) commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

PR Summary

Fix #27978

The dotnet-install.ps1 now works fine with PowerShell 7+. AI found no Windows PowerShell 5.1-only dependencies or PowerShell 7 incompatibilities. Validation performed:

  • Parsed successfully under PowerShell 7.6.6 with no syntax errors.
  • Completed dry runs for both ZIP and tar-aware download paths.
  • Verified automatic architecture detection through Get-CimInstance.
  • Verified HttpClient, proxy handling, and Add-Type usage.
  • Confirmed Invoke-WebRequest -UseBasicParsing remains accepted in PowerShell 7, although that switch is now effectively ignored.
  • Confirmed native tar is checked before use, with ZIP as the fallback.
  • Confirmed its disk-space validation intentionally runs only on PowerShell 7+, because Get-PSDrive space information can be unreliable on older PowerShell versions.

This PR updates the related script in build.psm1 to run dotnet-install.ps1 directly within the calling PowerShell.

PR Checklist

Copilot AI lite review requested due to automatic review settings September 17, 2026 05:18
@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.

🟢 Approval recommended

The change is localized and preserves the existing installation parameters while addressing the reported console behavior.

Pull request overview

Updates Windows .NET SDK installation to execute dotnet-install.ps1 in the current PowerShell process, avoiding unnecessary child-process console changes.

Changes:

  • Simplifies Windows installer argument construction.
  • Removes the Windows PowerShell subprocess invocation.
File summaries
File Description
build.psm1 Directly invokes the downloaded .NET installation script.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

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

@kilasuit Ryan Yates (kilasuit) left a comment

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.

👍

@kilasuit Ryan Yates (kilasuit) added the CL-Tools Indicates that a PR should be marked as a tools change in the Change Log label Sep 17, 2026
@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit 46337f9 into PowerShell:master Sep 17, 2026
39 of 41 checks passed
@daxian-dbw
Dongbo Wang (daxian-dbw) deleted the dotnet-install-ps1 branch September 17, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-Tools Indicates that a PR should be marked as a tools change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Running Start-PSBootstrap changes console defaults in conhost

5 participants