KEMBAR78
Remove UseDotnet task and use the dotnet-install script by adityapatwardhan · Pull Request #26093 · PowerShell/PowerShell · GitHub
Skip to content

Conversation

@adityapatwardhan
Copy link
Member

@adityapatwardhan adityapatwardhan commented Sep 25, 2025

PR Summary

This pull request refactors how the .NET SDK is installed in the build pipelines by introducing a new reusable template and updating all relevant pipeline templates to use it. It also updates the Install-Dotnet function to use a new download URL and cleans up legacy code paths. Additionally, it introduces a new pipeline parameter to control network isolation. These changes improve maintainability, consistency, and flexibility across the build system.

Pipeline .NET SDK Installation Refactor:

  • Added a new reusable template install-dotnet.yml for installing the .NET SDK, replacing multiple direct usages of the UseDotNet@2 task across all major pipeline templates (linux.yml, mac.yml, nupkg.yml, release-validate-fxdpackages.yml, release-validate-globaltools.yml, release-validate-sdk.yml, testartifacts.yml, windows-hosted-build.yml, windows-package-build.yml, linux-package-build.yml). This centralizes and standardizes .NET installation logic. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

  • Updated scripts in windows-hosted-build.yml and windows-package-build.yml to explicitly call Find-Dotnet after .NET installation, ensuring the correct .NET executable is located before proceeding. [1] [2] [3]

Improvements to Install-Dotnet Script:

  • Changed the Install-Dotnet function in build.psm1 to use the new download URL https://builds.dotnet.microsoft.com/dotnet/scripts/v1, and removed legacy code that handled different PowerShell environments, simplifying the function. [1] [2] [3]

Pipeline Flexibility and Parameters:

  • Added a new parameter disableNetworkIsolation to .pipelines/PowerShell-Packages-Official.yml, allowing builds to optionally disable network isolation via pipeline configuration, and propagated this parameter through variables and template invocations. [1] [2] [3]

Other Pipeline Improvements:

  • Updated the test artifacts pipeline to use new templates for setting version variables and cloning to the official path, further modularizing the pipeline. [1] [2]

PR Context

Allows the ability to use pre-release .NET SDKs

PR Checklist

@adityapatwardhan adityapatwardhan requested review from a team and jshigetomi as code owners September 25, 2025 21:36
@adityapatwardhan adityapatwardhan added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Sep 25, 2025
@adityapatwardhan
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@TravisEz13 TravisEz13 self-assigned this Oct 1, 2025
@TravisEz13 TravisEz13 merged commit 31cd731 into master Oct 1, 2025
55 checks passed
@TravisEz13 TravisEz13 deleted the removeUseDotnet branch October 1, 2025 21:09
@microsoft-github-policy-service
Copy link
Contributor

microsoft-github-policy-service bot commented Oct 1, 2025

📣 Hey @@adityapatwardhan, how did we do? We would love to hear your feedback with the link below! 🗣️

🔗 https://aka.ms/PSRepoFeedback

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

Labels

Backport-7.4.x-Migrated Backport-7.5.x-Migrated CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants