From f03da3fe6261e4db55cd3d99d23b36187634cf08 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Thu, 19 Feb 2026 22:19:34 +0000 Subject: [PATCH 1/2] Add PowerShell dependency to winget manifests Re-applies the change from PR #1497 which was reverted in PR #1548. The original broke the workflow YAML because the PowerShell here-string content and closing tag had zero indentation, which terminated the YAML literal block scalar (run: |). Fixed by indenting the here-string body to match the block indentation level; YAML strips the leading spaces, leaving valid PowerShell with the closing tag at column 0. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/winget.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/winget.yml b/.github/workflows/winget.yml index 094defe6..46f266f3 100644 --- a/.github/workflows/winget.yml +++ b/.github/workflows/winget.yml @@ -41,4 +41,24 @@ 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 -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: + - 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 + + # Submit the modified manifest + .\wingetcreate.exe submit manifests From 4884994dbe41278842138d43a44dcda74ad575a8 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Fri, 20 Feb 2026 10:21:37 +0000 Subject: [PATCH 2/2] Fix the winget submission script --- .github/workflows/winget.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/winget.yml b/.github/workflows/winget.yml index 46f266f3..873e55b3 100644 --- a/.github/workflows/winget.yml +++ b/.github/workflows/winget.yml @@ -56,9 +56,11 @@ jobs: - PackageIdentifier: Microsoft.PowerShell MinimumVersion: "7.0.0" "@ - # Insert dependency block before the Installers section + # Remove existing top-level Dependencies block (if any), then insert ours + $content = $content -replace '(?m)^Dependencies:\r?\n([ ]+.+\r?\n)*', '' $content = $content -replace '(?m)^Installers:', "$dependency`nInstallers:" Set-Content -Path $installerManifest -Value $content # Submit the modified manifest - .\wingetcreate.exe submit manifests + $manifestPath = Split-Path $installerManifest + .\wingetcreate.exe submit $manifestPath