Add PowerShell dependency to winget manifests#1497
Merged
SteveSandersonMS merged 2 commits intomainfrom Feb 17, 2026
Merged
Conversation
Modify the winget workflow to inject a PowerShell >= 7.0.0 dependency into the installer manifest before submission. This ensures users have PowerShell 7+ installed when installing via winget. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR modifies the winget workflow to add a PowerShell 7.0+ dependency to the installer manifests before submission to the WinGet community repository. This ensures that users installing GitHub Copilot or GitHub Copilot Prerelease via winget will have the required PowerShell version.
Changes:
- Modified wingetcreate to output manifests to a directory instead of submitting directly
- Added PowerShell script to inject a Dependencies.PackageDependencies block with Microsoft.PowerShell >= 7.0.0 into the installer YAML using regex-based string replacement
- Submit the modified manifest to winget repository
Comments suppressed due to low confidence (1)
.github/workflows/winget.yml:60
- The submit command doesn't verify that the manifest modification was successful or that the resulting YAML is valid. If the regex replacement fails or produces malformed YAML, wingetcreate submit will fail. Consider adding validation of the modified manifest before submission, such as checking that the file can be parsed as valid YAML or that wingetcreate can validate it.
.\wingetcreate.exe submit manifests
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a728ae7 to
8d7e467
Compare
- Add check for missing installer manifest with error message - Remove -NoNewline to preserve YAML file conventions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
devm33
approved these changes
Feb 17, 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
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 PR modifies the winget workflow to inject a PowerShell >= 7.0.0 package dependency into the installer manifest before submission.
Changes
Dependencies.PackageDependenciesblock withMicrosoft.PowerShell >= 7.0.0into the installer YAMLThis ensures users installing via
winget install GitHub.Copilotorwinget install GitHub.Copilot.Prereleasewill have PowerShell 7+ as a dependency.Reference: microsoft/winget-pkgs#335848. Note that this didn't work because it only affected a single version. I had been under the impression that extra manifest content was preserved across versions but they were not. Seems we have to change the manifest before we submit it.