Skip to content

Add PowerShell dependency to winget manifests#1497

Merged
SteveSandersonMS merged 2 commits intomainfrom
add-powershell-dependency
Feb 17, 2026
Merged

Add PowerShell dependency to winget manifests#1497
SteveSandersonMS merged 2 commits intomainfrom
add-powershell-dependency

Conversation

@SteveSandersonMS
Copy link
Contributor

@SteveSandersonMS SteveSandersonMS commented Feb 17, 2026

This PR modifies the winget workflow to inject a PowerShell >= 7.0.0 package dependency into the installer manifest before submission.

Changes

  • Output manifests to a directory instead of submitting directly
  • Insert Dependencies.PackageDependencies block with Microsoft.PowerShell >= 7.0.0 into the installer YAML
  • Submit the modified manifest

This ensures users installing via winget install GitHub.Copilot or winget install GitHub.Copilot.Prerelease will 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.

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>
Copilot AI review requested due to automatic review settings February 17, 2026 13:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@SteveSandersonMS SteveSandersonMS force-pushed the add-powershell-dependency branch from a728ae7 to 8d7e467 Compare February 17, 2026 14:03
- 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>
@SteveSandersonMS SteveSandersonMS merged commit 1c1181d into main Feb 17, 2026
3 checks passed
@SteveSandersonMS SteveSandersonMS deleted the add-powershell-dependency branch February 17, 2026 14:21
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.

2 participants

Comments