From ee89712238a280fa0429abe0f790f2399eed404a Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Thu, 19 Feb 2026 22:19:34 +0000 Subject: [PATCH] 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