From 8d7e4679ec3a643ea8b93679f8123115f60d9816 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Tue, 17 Feb 2026 13:58:51 +0000 Subject: [PATCH 1/2] Add PowerShell dependency to winget manifests 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> --- .github/workflows/winget.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/winget.yml b/.github/workflows/winget.yml index 094defe..a8db411 100644 --- a/.github/workflows/winget.yml +++ b/.github/workflows/winget.yml @@ -41,4 +41,20 @@ jobs: .\wingetcreate.exe update $packageId ` --version $packageVersion ` --urls "$installerUrlx64|x64" "$installerUrlarm64|arm64" ` - --submit + --out manifests + + # Add PowerShell dependency to installer manifest + $installerManifest = Get-ChildItem -Path manifests -Filter "*.installer.yaml" -Recurse | Select-Object -First 1 + $content = Get-Content $installerManifest -Raw + $dependency = @" +Dependencies: + PackageDependencies: + - PackageIdentifier: Microsoft.PowerShell + MinimumVersion: "7.0.0" +"@ + # Insert dependency block before the Installers section + $content = $content -replace '(?m)^Installers:', "$dependency`nInstallers:" + Set-Content -Path $installerManifest -Value $content -NoNewline + + # Submit the modified manifest + .\wingetcreate.exe submit manifests From d1623992583be4090ebb9711210718753b3ffc4c Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Tue, 17 Feb 2026 14:04:07 +0000 Subject: [PATCH 2/2] Address CR feedback: add error handling and fix newline - 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> --- .github/workflows/winget.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/winget.yml b/.github/workflows/winget.yml index a8db411..acb0ad6 100644 --- a/.github/workflows/winget.yml +++ b/.github/workflows/winget.yml @@ -44,8 +44,12 @@ jobs: --out manifests # Add PowerShell dependency to installer manifest - $installerManifest = Get-ChildItem -Path manifests -Filter "*.installer.yaml" -Recurse | Select-Object -First 1 - $content = Get-Content $installerManifest -Raw + $installerManifest = Get-ChildItem -Path manifests -Filter "*.installer.yaml" -Recurse | Select-Object -First 1 -ExpandProperty FullName + if (-not $installerManifest) { + Write-Error "No installer manifest (*.installer.yaml) was found in the 'manifests' directory." + exit 1 + } + $content = Get-Content -Path $installerManifest -Raw $dependency = @" Dependencies: PackageDependencies: @@ -54,7 +58,7 @@ Dependencies: "@ # Insert dependency block before the Installers section $content = $content -replace '(?m)^Installers:', "$dependency`nInstallers:" - Set-Content -Path $installerManifest -Value $content -NoNewline + Set-Content -Path $installerManifest -Value $content # Submit the modified manifest .\wingetcreate.exe submit manifests