Skip to content

Fix Windows release job: WebView2 step used CMD syntax under PowerShell shell - #60

Closed
markmybytes with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-windows-release-job
Closed

Fix Windows release job: WebView2 step used CMD syntax under PowerShell shell#60
markmybytes with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-windows-release-job

Conversation

Copilot AI commented Sep 5, 2026

Copy link
Copy Markdown

The Download and extract WebView2 runtime step in build_and_release.yml failed on windows-latest because it had no explicit shell: set, defaulting to pwsh, while its commands (mkdir, rmdir /s /q) were written for cmd. PowerShell rejected rmdir /s /q ext with A positional parameter cannot be found that accepts argument '/q', breaking the release build.

Changes

  • Set shell: pwsh explicitly on the step to remove ambiguity about which shell executes it.
  • Replaced CMD-specific commands with their PowerShell equivalents:
    • cdSet-Location
    • mkdirNew-Item -ItemType Directory -Force
    • moveMove-Item -Force
    • rmdir /s /qRemove-Item -Recurse -Force
    • delRemove-Item -Force
- name: Download and extract WebView2 runtime
  shell: pwsh
  run: |
    Set-Location build\bin
    curl -o webview2.nupkg -L "https://globalcdn.nuget.org/packages/webview2.runtime.${{ matrix.wv2arch }}.151.0.4129.107.nupkg?packageVersion=151.0.4129.107"
    New-Item -ItemType Directory -Force -Path internals\bin | Out-Null
    7z x webview2.nupkg -oext -y
    Move-Item -Force ext\contentFiles\any\any\WebView2 internals\bin\WebView2
    Remove-Item -Recurse -Force ext
    Remove-Item -Force webview2.nupkg

Other steps in the workflow relying on mkdir/cd were left untouched since those are valid PowerShell aliases and don't error out; only rmdir /s /q used CMD-only flags. Packaging behavior (download, extract, move into internals\bin\WebView2, cleanup) is unchanged.

Co-authored-by: markmybytes <71750702+markmybytes@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing Windows release job in build_and_release.yml Fix Windows release job: WebView2 step used CMD syntax under PowerShell shell Sep 5, 2026
Copilot AI requested a review from markmybytes September 5, 2026 03:35
@markmybytes markmybytes closed this Sep 5, 2026
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