Skip to content

Filter Install-PSResource runtime assets by RID - #2074

Draft
Justin Chung (jshigetomi) wants to merge 1 commit into
PowerShell:masterfrom
jshigetomi:jshigetomi-rid-runtime-filtering
Draft

Justin Chung (jshigetomi) wants to merge 1 commit into
PowerShell:masterfrom
jshigetomi:jshigetomi-rid-runtime-filtering

Conversation

@jshigetomi

Copy link
Copy Markdown
Contributor

PR Summary

Reintroduces only the runtime identifier (RID) filtering portion of #1963 after the combined RID/TFM change was reverted by #2070 because of a TFM filtering bug.

  • Adds -RuntimeIdentifier to Install-PSResource, including argument completion.
  • Automatically selects assets for the current runtime, supports explicit cross-RID selection, and applies compatible/generic RID fallbacks.
  • Filters only PowerShell's deliberate root-level RID package layout, such as win-x64/... and linux-x64/....
  • Intentionally leaves standard NuGet runtimes/{rid}/... content and all lib/{tfm}/... content untouched.
  • Preserves explicit-override merging when the same package/version is already installed. Merge state is scoped to each ParentInstallWorkItem, and existing files are not overwritten.
  • Leaves dependency resolution and normal package installation behavior unchanged.

Validation:

  • .\build.ps1 -Clean -Build -BuildConfiguration Debug -BuildFramework net472 — passed.
  • PowerShell 7.6.9: Pester 4.10.1 against .\test\RIDFilteringTests with tag CI — 27 passed, 0 failed.
  • Windows PowerShell 5.1: Pester 4.10.1 against .\test\RIDFilteringTests with tag CI — 27 passed, 0 failed.
  • Invoke-ScriptAnalyzer -Path .\test\RIDFilteringTests -Recurse with PSScriptAnalyzer 1.25.0 — passed with no findings.
  • Install-PSResource TestModuleWithDependencyC -Version 1.0.0.0 under PowerShell 7 — passed; expected dependencies were installed.

PR Context

This draft is the standalone RID-only extraction requested after #2070. It deliberately excludes every TFM/lib filtering and TFM-aware dependency-group change from #1963. It also does not broaden filtering to the standard NuGet runtimes/{rid}/... layout.

Tooling impact is limited to the new public Install-PSResource -RuntimeIdentifier parameter and its argument completer.

PR Checklist

  • Make sure all checks pass.
  • Make sure you have a meaningful title for the PR.
  • Summarized your change in the PR summary.
  • The code change is tested and covered by new unit tests.
  • Verify the change is not breaking existing behavior.
  • Signing the PR title and the commit with Developer Certificate of Origin (DCO) following https://github.com/PowerShell/PowerShell/blob/master/6.0-Windows/security/opensource.md
  • This PR is ready to merge and is not Work in Progress.
    • If the PR is work in progress, please add the prefix WIP: or Do not merge: to the PR title and do not check this box.
  • Copyright: By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.
  • Breaking Changes
    • None
    • Yes, and details are included in the PR summary
  • Documentation
  • Testing
    • This PR includes tests for new behavior.
    • This PR includes regression tests for existing behavior.
  • Tooling Impact
    • I have considered the tooling impact and no additional tooling considerations are needed.
    • I have considered the tooling impact and have enumerated the concerns in the PR summary.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

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

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

None yet

Development

Successfully merging this pull request may close these issues.

1 participant