FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Replace global tool shim with RID-specific .NET 11 packaging by jshigetomi · Pull Request #28396 · PowerShell/PowerShell · GitHub

Repository navigation

Replace global tool shim with RID-specific .NET 11 packaging - #28396

Open
Justin Chung (jshigetomi) wants to merge 3 commits into
PowerShell:masterfrom
jshigetomi:jshigetomi-global-tool-infrastructure
Open

Justin Chung (jshigetomi) wants to merge 3 commits into
PowerShell:masterfrom
jshigetomi:jshigetomi-global-tool-infrastructure

Conversation

Justin Chung (jshigetomi) commented Nov 11, 2026 •
edited
Loading

Copy link
Copy Markdown
Collaborator

PR Summary

  • replace Microsoft.PowerShell.GlobalTool.Shim with RID-specific .NET tool sub-packages and a RID-agnostic pointer package
  • update the cross-platform global-tool project to target .NET 11
  • export VSS_NUGET_EXTERNAL_FEED_ENDPOINTS to the global-tool publish and pack steps for authenticated Azure Artifacts access

PR Context

The previous global tool bundled Windows and Unix payloads behind a custom runtime-selection shim. This change adopts the .NET SDK's RID-specific tool packaging model: each supported RID is built and signed independently, while a lightweight pointer package maps installations to the correct RID package.

The project targets .NET 11 to align with the repository SDK dependencies. The packaging tasks also explicitly map the secret Azure Artifacts endpoint credentials into each dotnet task environment because Azure Pipelines does not automatically export secret variables.

Azure DevOps source commits, preserved in chronological order:

  1. 5cd15d2f9e1f0c090477d58a5a4148c5d8d7ae59 — Replace GlobalTool.Shim with RID-specific .NET tool
  2. 00a84d903c9c404e4deae7ebc12ff945af5db171 — Update cross-platform global tool to target .NET 11
  3. c23488d8bd29f5fc5c50ab6fac951ed53b0e6a65 — Fix NuGet authentication for global tool packaging

Validation:

  • parsed all 10 changed Azure Pipelines YAML files with PyYAML — passed
  • parsed build.psm1, tools\packaging\packaging.psm1, tools\packaging\packaging.psd1, and tools\packaging\packaging.strings.psd1 with the PowerShell parser — passed
  • generated and XML-validated a test RID pointer package source for win-x64 and linux-x64 — passed
  • dotnet restore src\GlobalTools\PowerShell\PowerShell.csproj --runtime win-x64 /p:NuGetAudit=false — passed
  • dotnet msbuild src\GlobalTools\PowerShell\PowerShell.csproj -getProperty:TargetFramework -getProperty:ToolPackageRuntimeIdentifiers — passed (net11.0 and all eight expected RIDs)
  • git diff --check origin/master...HEAD — passed

PR Checklist

Justin Chung (jshigetomi) requested a review from a team as a code owner November 11, 2026 15:06
Copilot AI balanced review requested due to automatic review settings November 11, 2026 15:06

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

🟡 Changes recommended

Linux/macOS packages built on Windows use incorrect platform implementations, while missing PSMaml schemas break XML help installation and the preparation step lacks required restore-phase configuration.

3 open issues What changed in this PR

This PR aligns PowerShell global-tool packaging with the repository’s .NET 11 dependencies and supplies credentials for authenticated Azure Artifacts restores.

Changes:

  • Targets the cross-platform global-tool project at net11.0, with runtime-specific packages.
  • Maps VSS_NUGET_EXTERNAL_FEED_ENDPOINTS into both publish and pack task environments.
  • Provides per-runtime publish, signing, and package post-processing steps.
File Description
src/​GlobalTools/​PowerShell/​PowerShell.csproj Defines the .NET 11 global tool and its platform-specific dependencies and content.
.pipelines/​templates/​step/​globaltool-rid-pack.yml Publishes, signs, and packs runtime-specific tools with explicit feed credentials.

Review effort: Balanced

Start-TypeGen
Write-Verbose -Verbose "Publishing PowerShell global tool for RID: $rid"
dotnet publish -r $rid --no-self-contained --artifacts-path $artifactsPath /property:PackageVersion=$(Version) --configuration Release /property:ReleaseTag=$ReleaseTagToUse
displayName: 'Publish PowerShell global tool (${{ parameters.Rid }})'
env:
__DOTNET_RUNTIME_FEED_KEY: $(RUNTIME_SOURCEFEED_KEY)
VSS_NUGET_EXTERNAL_FEED_ENDPOINTS: $(VSS_NUGET_EXTERNAL_FEED_ENDPOINTS)

<ItemGroup>
<Compile Include="..\..\powershell\Program.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
<None Include="..\PowerShell.Windows.x64\Powershell_64.png" Pack="true" PackagePath="" />
Justin Chung added 3 commits November 11, 2026 12:08
## Summary
- update `src/GlobalTools/PowerShell/PowerShell.csproj` from `net10.0` to `net11.0`
- align the cross-platform Global Tool with `Microsoft.PowerShell.SDK` and the Windows Global Tool
- fix Release Branch Prep vulnerability-scanner restore failures after moving release/v7.7.0 to .NET 11

## Validation
- `dotnet restore src\GlobalTools\PowerShell\PowerShell.csproj --runtime win-x64 /p:NuGetAudit=false`
<!-- Anything that looks like this is a comment and can't be seen after the Pull Request is created. -->

# PR Summary

Explicitly maps `VSS_NUGET_EXTERNAL_FEED_ENDPOINTS` into the environment of both global-tool steps that invoke `dotnet`: the restore/publish step and the later pack step.

## PR Context

Packaging build 738142 failed in all eight global-tool RID matrix jobs with NU1301 / HTTP 401 while restoring from the `powershell-net-11-early-access` Azure Artifacts feed.

`.pipelines/templates/insert-nuget-config-azfeed.yml` creates `VSS_NUGET_EXTERNAL_FEED_ENDPOINTS` as a secret pipeline variable, but Azure Pipelines does not automatically export secret variables into subsequent task environments. The global-tool publish step only mapped `__DOTNET_RUNTIME_FEED_KEY`, so the Azure Artifacts Credential Provider could not read the endpoint credentials. This change explicitly exports the secret variable to restore/publish and pack for consistent authenticated NuGet access.

Validation:
- `git diff --check` — passed
- `python -c "import pathlib, yaml; p=pathlib.Path(r'.pipelines\\templates\\step\\globaltool-rid-pack.yml'); yaml.safe_load(p.read_text(encoding='utf-8')); print('YAML parsed successfully')"` — passed (`YAML parsed successfully`)

## PR Checklist

- [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
  - Use the present tense and imperative mood when describing your changes
- [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
- [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
- [x] This PR is ready to merge. If this PR is a work in progress, please open this as a [Draft Pull Request and mark it as Ready to Review when it is ready to merge](https://docs.github.com/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests#draft-pull-requests).
- **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)**
  - [x] None
  - **OR**
  - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/7.5/Microsoft.PowerShell.Core/About/about_Experimental_Features.md)
    - [ ] Experimental feature name(s):
- **User-facing changes**
  - [x] Not Applicable
  - **OR**
  - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
    - [ ] Issue filed:
- **Testing - New and feature**
  - [x] N/A or can only be tested interactively
  - **OR**
  - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.githu...
Justin Chung (jshigetomi) force-pushed the jshigetomi-global-tool-infrastructure branch from 0b20fce to 8d22946 Compare November 11, 2026 18:09
Justin Chung (jshigetomi) changed the title Update global tool packaging for .NET 11 Replace global tool shim with RID-specific .NET 11 packaging Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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


Back | FazBrowse Home | New Git URL