Externalize findMissingNotices target framework selection with ordered Windows fallback#27269
Merged
TravisEz13 merged 4 commits intomasterfrom Apr 15, 2026
Merged
Conversation
|
Azure Pipelines: 5 pipeline(s) require an authorized user to comment /azp run to run. |
Agent-Logs-Url: https://github.com/PowerShell/PowerShell/sessions/dc3008a7-e02e-4751-a54d-1f72a5817e6a Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
|
Azure Pipelines: 5 pipeline(s) require an authorized user to comment /azp run to run. |
Agent-Logs-Url: https://github.com/PowerShell/PowerShell/sessions/dc3008a7-e02e-4751-a54d-1f72a5817e6a Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
|
Azure Pipelines: 5 pipeline(s) require an authorized user to comment /azp run to run. |
Copilot
AI
changed the title
[WIP] Update findMissingNotices.ps1 to use JSON config for target frameworks
Externalize Apr 15, 2026
findMissingNotices target framework selection with ordered Windows fallback
TravisEz13
reviewed
Apr 15, 2026
|
Azure Pipelines: 5 pipeline(s) require an authorized user to comment /azp run to run. |
adityapatwardhan
approved these changes
Apr 15, 2026
TravisEz13
approved these changes
Apr 15, 2026
|
Azure Pipelines: 5 pipeline(s) require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR moves findMissingNotices.ps1 target framework selection into a repo-tracked JSON config and updates Windows target resolution to pick the first configured Windows TFM that exists in project.assets.json, with fallback to the base target.
Changes:
- Added
tools/findMissingNotices.targets.jsonto definedotnetTargetNameand orderedwindowsTargetNames. - Added script-scope config loading + validation in
tools/findMissingNotices.ps1. - Reworked Windows target selection in
Get-CGRegistrationsto choose a configured TFM based on available assets targets (with base-target fallback).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| tools/findMissingNotices.targets.json | Introduces config-driven base/Windows TFM selection settings. |
| tools/findMissingNotices.ps1 | Loads/validates the config and updates Windows/non-Windows target selection logic accordingly. |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This updates
tools/findMissingNotices.ps1to remove hard-coded TFMs and drive target selection from repo-tracked JSON config. Windows target resolution now uses full configured Windows TFMs in priority order, with explicit fallback to base target when available and no implicit Win7 target construction.Config-driven target frameworks
tools/findMissingNotices.targets.jsonwith:dotnetTargetName(base/non-Windows target)windowsTargetNames(ordered full Windows TFM candidates; optional/empty allowed)Script-scope config loading and validation
tools/findMissingNotices.ps1.Windows target selection logic in
Get-CGRegistrations$dotnetTargetName/$dotnetTargetNameWin7.project.assets.jsonviaNew-PADrive.windowsTargetNames(in order).dotnetTargetNameif present.Behavior preserved for non-Windows and modules
modulesruntime behavior remains unchanged (base target +linux-x64runtime).Original prompt
Create a pull request in PowerShell/PowerShell (base branch: master) to update tools/findMissingNotices.ps1 so that:
Implementation guidance:
Deliverables:
Provide a sensible default based on existing hard-coded values (but do not include Win7-specific tfm like *-windows8.0 unless it truly exists).
Please include any necessary documentation/comments in the script/config so future maintainers understand ordering/fallback behavior.
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Suggest improvements to this code.
Assistant: ### 1) Smells / antipatterns in the highlighted area
The snippet is just:
…but in context it points to a few concrete issues:
net11.0is embedded directly in the function. When the repo updates TFMs (e.g., net9.0 → net10.0), this becomes a recurring maintenance hotspot and easy to miss.$dotnetTargetNameWin7 = 'net11.0-windows8.0'. These are coupled (same base TFM), but are specified separately—easy for them to drift..NET 11is not a currently released TFM. PowerShell typically targets a released .NET (recently net8.0 / net9.0). If this is a real repo line, it’s likely a typo or a temporary experiment that will break restores in most environments.Get-CGRegistrationsis doing restore/asset parsing and defining what TFMs to use. That makes it harder to test and harder to reuse.2) Concrete improvements (with working code)
Option A: Derive the TFM from the project being restored (best: avoids hard-coding)
Since you
Push-Locationinto the project folder, you can read the project file and pullTargetFramework/TargetFrameworks.Then in
Get-CGRegistrations, replace the hard-coded assignment with something like:Benefits:
Option B: Make TFMs parameters (good for CI and local overrides)
If you want the script to be explicit and override-able: