From 1c41025086b0c5de90f06d890ccf6d5f2ba1441d Mon Sep 17 00:00:00 2001 From: Neil Richardson Date: Fri, 28 Aug 2026 12:22:19 +0100 Subject: [PATCH] Fix NonInteractive Invoke-WebRequest failure in GitHub WebHook pipeline Windows PowerShell 5.1's Invoke-WebRequest parses responses with the IE COM engine. On the hosted windows-2022 agent IE first-run configuration has not been completed, so parsing tries to prompt and throws PSInvalidOperationException in NonInteractive mode. The POST itself succeeds and the forward build is queued, but the task still fails. Add -UseBasicParsing to skip the IE DOM parser. StatusCode, Headers and RawContent used later in the script are unaffected. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .github/pipelines/github-webhook.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/pipelines/github-webhook.yml b/.github/pipelines/github-webhook.yml index b831211bd..1cca638b5 100644 --- a/.github/pipelines/github-webhook.yml +++ b/.github/pipelines/github-webhook.yml @@ -78,7 +78,7 @@ extends: "Content-Type" = "application/json"; "Authorization" = "Bearer $env:UAMI_TOKEN" } - $Response = Invoke-WebRequest -Method 'POST' -Body $Body -Uri "https://office.visualstudio.com/OC/_apis/build/builds?api-version=7.1" -Headers $headers + $Response = Invoke-WebRequest -UseBasicParsing -Method 'POST' -Body $Body -Uri "https://office.visualstudio.com/OC/_apis/build/builds?api-version=7.1" -Headers $headers if ($Response.StatusCode -ne 200) { Write-Warning "Non-200 status code encountered."